kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Wed Oct 25, 2006 8:18 am Post subject: |
|
|
Try this DFSORT JCL. The first step0100 will create dynamic control cards for allocation and also for splitting. The Second step0200 will create the entire JCL to be execueted. Check the output from step0200, if you see everything is correct then change this statement in step0200
Code: |
//SORTOUT DD SYSOUT=*
|
to
Code: |
//SORTOUT DD SYSOUT=(*,INTRDR)
|
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
HEADER1
RECORD1
RECORD2
RECORD3
RECORD4
TRAILER1
HEADER2
RECORD5
RECORD6
RECORD7
TRAILER2
HEADER3
RECORD8
RECORD9
RECORD10
TRAILER3
//ALLOCDSN DD DSN=&A,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE)
//CARDS DD DSN=&C,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE)
//FULLDSN DD DSN=your seqnum numbered dsn,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),
OVERLAY=(81:SEQNUM,8,ZD,START=1,INCR=2)),
IFTHEN=(WHEN=(1,7,CH,EQ,C'TRAILER'),
OVERLAY=(81:SEQNUM,8,ZD,START=1,INCR=2)),
IFTHEN=(WHEN=NONE,
OVERLAY=(89:SEQNUM,8,ZD,
81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
OUTFIL FNAMES=FULLDSN,
OUTREC=(01,88)
OUTFIL FNAMES=ALLOCDSN,
INCLUDE=(01,06,CH,EQ,C'HEADER'),
OUTREC=(C'//OUT',SEQNUM,5,ZD,X,
C'DD DSN=OUT',SEQNUM,5,ZD,
C'.FILE',/,
C'//',12X,
C'DISP=(NEW,CATLG,DELETE),',/,
C'//',12X,
C'UNIT=SYSDA,',/,
C'//',12X,
C'SPACE=(CYL,(1,1,),RLSE)',/,
C'/*',80:X)
OUTFIL FNAMES=CARDS,REMOVECC,NODETAIL,
OUTREC=(1,80),
HEADER1=(C'//SYSIN DD *',/,
C' SORT FIELDS=COPY',80:X),
SECTIONS=(81,8,
TRAILER3=(C' OUTFIL FNAMES=OUT',84,5,
C',INCLUDE=(81,8,ZD,EQ,',81,8,
C'),OUTREC=(1,80)',80:X)),
TRAILER1=(C'/*',80:X)
/*
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
//SORTOUT DD SYSOUT=*
//SORTIN DD DATA,DLM=$$
//USERIDA JOB 'SPLIT COPY',
// CLASS=A,
// MSGCLASS=Y,
// MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
//*
//COPYSTEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your seqnum numbered dsn,
// DISP=SHR
//*
$$
// DD DSN=&A,DISP=(OLD,PASS)
// DD DSN=&C,DISP=(OLD,PASS)
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|