Saturday, May 21, 2011

SORT JCL to copy all the data from the input dataset to the output dataset

COMMON JCL FOR SORT
//SORTJCL JOB (XXXXXXXX,,,,,XXXX),' ',
// CLASS=M,MSGCLASS=T,
// REGION=0M,NOTIFY=&SYSUID
//*
//***************************************************************
//DEL EXEC PGM=IEFBR14
//DD01 DD DSN=Output dataset, *Deleting the Output file
// DISP=(MOD,DELETE),UNIT=SYSDA,SPACE=(TRK,(1))
//***************************************************************
//SETP001 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//REPORT1 DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=Input dataset, *Input file
//SORTOUT DD DSN=Output dataset, *Creating output file
// DISP=(,CATLG),
// SPACE=(TRK,(30,10),RLSE),
// UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)
//SYSIN DD *
SORT FIELDS=COPY
//*


This JCL is used copy all the data from the input dataset to the output dataset.

In the sort card, we can also give OPTION COPY instead of SORT FIELDS=COPY to do the same task.

No comments:

Post a Comment