Monday, September 26, 2011

JCL : copy all members from a PDS to a sequential file

The below job copies all the members of a PDS to a sequential file.


//PUNCH EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=MY.USER.CNTL,DISP=SHR
//SYSUT2   DD DISP=(NEW,PASS),DSN=&&TEMP,
// SPACE=(TRK,(50,50),RLSE),
// DCB=(LRECL=81,RECFM=FB,BLKSIZE=0)
//SYSIN    DD *
PUNCH TYPORG=PO
//* DROP HEADERS
//DHEAD EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN   DD DISP=(OLD,DELETE),DSN=&&TEMP
//SORTOUT  DD DISP=(NEW,CATLG),DSN=MY.COPY.CARDS,
// SPACE=(TRK,(50,50),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SYSIN    DD *
SORT FIELDS=COPY
OMIT COND=(2,12,CH,EQ,C'MEMBER NAME ')
OUTREC FIELDS=(2,80)
/*


The problem with the IEBPTPCH solution is SYSUT2 is always unblocked; you cannot block it.


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.