Suppressing the file based on Outrec
Moderators: Frank Yaeger, Moderator Group
Suppressing the file based on Outrec
Hi,
I have a PS file which contains below records.
01
03
01
03
01
03
01
02
03
01
03
01
02
03
01
03
Now from the above file I want to suppress only the bold records i.e see below
01
02
03
01
02
03
the Outfile should get same order from the input file..I mean only 01 02 03 order records.
Please let me know by using outrec. Thanks.
I have a PS file which contains below records.
01
03
01
03
01
03
01
02
03
01
03
01
02
03
01
03
Now from the above file I want to suppress only the bold records i.e see below
01
02
03
01
02
03
the Outfile should get same order from the input file..I mean only 01 02 03 order records.
Please let me know by using outrec. Thanks.
Last edited by venky on Tue Sep 11, 2012 1:25 am, edited 1 time in total.
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
I'm still not sure of what you want.
I'm assuming you have "header", 01, "trailer", 03, always. Sometimes one "data", 02.
I'm not sure whether you want to keep or exclued the 01,02,03 groups. So:
This is the first part:
Then, if you want the 01,02,03 records
Giving
Alternatively, if you want the 01,03 records
Giving
If you want something else, you'll have to be clearer.
I'm assuming you have "header", 01, "trailer", 03, always. Sometimes one "data", 02.
I'm not sure whether you want to keep or exclued the 01,02,03 groups. So:
This is the first part:
Code: Select all
//DROPGRP EXEC PGM=SORT
//CHKOUT DD DUMMY
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC IFTHEN=(WHEN=GROUP,
BEGIN=(1,2,CH,EQ,C'01'),
END=(1,2,CH,EQ,C'03'),
PUSH=(3:ID=1)),
IFTHEN=(WHEN=GROUP,
BEGIN=(1,2,CH,EQ,C'01'),
RECORDS=3,
PUSH=(4:3,1,7:1,2)),
IFTHEN=(WHEN=GROUP,
BEGIN=(1,2,CH,EQ,C'02'),
RECORDS=2,
PUSH=(5:3,1,9:1,2)),
IFTHEN=(WHEN=GROUP,
BEGIN=(1,2,CH,EQ,C'03'),
RECORDS=1,
PUSH=(6:3,1))
Code: Select all
OUTFIL INCLUDE=(3,1,CH,EQ,4,1,CH,
AND,
3,1,CH,EQ,5,1,CH,
AND,
3,1,CH,EQ,6,1,CH),
BUILD=(7,2,/,9,2,/,1,2)
Code: Select all
01
02
03
01
02
03
Code: Select all
OUTFIL INCLUDE=(1,2,CH,EQ,C'03',
AND,
(3,1,CH,NE,4,1,CH,
OR,
3,1,CH,NE,5,1,CH,
OR,
3,1,CH,NE,6,1,CH)),
BUILD=(7,2,/,1,2)
Code: Select all
01
03
01
03
01
03
01
03
01
03
If you want something else, you'll have to be clearer.
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page