Repeatable header and trailer using sort
Moderators: Frank Yaeger, Moderator Group
Repeatable header and trailer using sort
Hi,
Need to a create header and trailer for every 254 records read from input file. I have a sequential file with list of dataset. using a skeleton copy JCL's are created. Now need to insert a repeatable header (Job Card) and trailer (// ) for every 254 step. Please find the below sample data.
Input : 80, FB
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1293V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1294V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1295V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1296V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1297V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1298V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1299V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1300V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1301V00
Output: 80 FBA
Header(job card)
Filename1
.....
Filename200
trailer(// )
header(job card)
filename201
....
filename400
trailer(// )
Kindly help me in performing this using DFSORT. My shop is using syncsort.
_________________
magesh
Need to a create header and trailer for every 254 records read from input file. I have a sequential file with list of dataset. using a skeleton copy JCL's are created. Now need to insert a repeatable header (Job Card) and trailer (// ) for every 254 step. Please find the below sample data.
Input : 80, FB
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1293V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1294V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1295V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1296V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1297V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1298V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1299V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1300V00
XXXXXXX.MAJORDS.ASDFATTB.D5010.G1301V00
Output: 80 FBA
Header(job card)
Filename1
.....
Filename200
trailer(// )
header(job card)
filename201
....
filename400
trailer(// )
Kindly help me in performing this using DFSORT. My shop is using syncsort.
_________________
magesh
magesh
Code: Select all
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=REPORT,LINES=255,REMOVECC,
HEADER2=(C'//TFT156@@ JOB 0000,COPY DSNS,CLASS=H,MSGCLASS=X,',/,
1:C'// NOTIFY=&SYSUID,REGION=0M,TYPRUN=SCAN'),
OUTREC=(C'//SORT',7:SEQNUM,4,ZD,START=00,INCR=01,
11:C' ',12:C'EXEC',16:C' ',
17:C'PGM=SORT',/,1:C'//SYSOUT DD SYSOUT=*',/,
1:C'//SYSOUT DD SYSOUT=*',/,1:C'//SYSPRINT DD SYSOUT=*',
/,1:C'//SYSABEND DD DUMMY',/,1:C'//SORTIN DD DISP=SHR,',
24:C'DSN=',1,44,SQZ=(SHIFT=LEFT,MID=C'(0)'),/,
1:C'//SORTOUT DD DSN=',1,44,SQZ=(SHIFT=LEFT,MID=C'.TESTCOPY,'),
/,1:C'// DISP=(NEW,CATLG,DELETE),',/,1:C'// LIKE=-
',1,44,SQZ=(SHIFT=LEFT,MID=C'(0),'),/,1:C'// UNIT=VTAPE',
/,1:C'// LABEL=RETPD=&RETPD,',/,1:C'// VOL=(,,,50-
)',/,1:C'//* '),
TRAILER2=(C'// ')
/*
magesh
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
The goal is to generate a set of sort JCL/Control Statements for each record in the input file. Each record contains the DSN to be used in that sort step.At the beginning should be a header and after each 254 "sets", generate a new header.
As i read the posted outrec info, the disps are not what is used.
What does the curent output look like?
But, maybe i misunderstand.
As i read the posted outrec info, the disps are not what is used.
What does the curent output look like?
But, maybe i misunderstand.
Have a good one
Hi DikDude,
Your are correct in terms of explaining the goal, Thanks. Please find the below for how the Output looks like.
As I mentioned earlier Header (job card) is repeated for every 255 line. Goal is to acheieve a Header (job card) for every 255 input record read from input rather than 255 line number on the output file.
Your are correct in terms of explaining the goal, Thanks. Please find the below for how the Output looks like.
Code: Select all
//TFT156@@ JOB 0000,COPYDSNS,CLASS=H,MSGCLASS=X,
// NOTIFY=&SYSUID,REGION=0M,TYPRUN=SCAN
//SORT0000 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSABEND DD DUMMY
//SORTIN DD DISP=SHR,DSN=TFT156.MAJORDS.ASDFATTB.D5010(0)
//SORTOUT DD DSN=TFT156.MAJORDS.ASDFATTB.D5010.TESTCOPY,
// DISP=(NEW,CATLG,DELETE),
// LIKE=TFT156.MAJORDS.ASDFATTB.D5010(0),
// UNIT=VTAPE,
// LABEL=RETPD=&RETPD,
// VOL=(,,,50)
//SYSIN DD *
SORT FIELDS=COPY
/*
//*
magesh
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