Tags

, , , ,

SORT – INREC, INCLUDE and OMIT

Include
//* COPY INPUT FILE TO OUTPUT FILE BUT MOVE AS FOLLOWS
//* PUT THIS IN OUTPUT COLUMN 20: 9 CHARACTERS STARTING IN COLUMN 1
//* COLUMN 40: 16 CHARACTERS STARTING IN COLUMN 10
//* INCLUDE ONLY RECORDS FROM CT
//SORTIT EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=USERID.SORT.INPUT,DISP=SHR
//SORTOUT DD DSN=USERID.SORT.OUTPUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(WORK,8),
// SPACE=(CYL,(5,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SORTWK01 DD UNIT=WORK,SPACE=(CYL,(5,1))
//SORTWK02 DD UNIT=WORK,SPACE=(CYL,(5,1))
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(20:1,09,40:10,16)
INCLUDE COND=(19,2,CH,EQ,C’CT’)
/*
//* END OF JOB
 
Omit
/* COPY INPUT FILE TO OUTPUT FILE BUT MOVE AS FOLLOWS
//* PUT THIS IN OUTPUT COLUMN 20: 9 CHARACTERS STARTING IN COLUMN 1
//* COLUMN 40: 16 CHARACTERS STARTING IN COLUMN 10
//* OMIT ONLY RECORDS FROM DT
//SORTIT EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=USERID.SORT.INPUT,DISP=SHR
//SORTOUT DD DSN=USERID.SORT.OUTPUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(WORK,8),
// SPACE=(CYL,(5,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SORTWK01 DD UNIT=WORK,SPACE=(CYL,(5,1))
//SORTWK02 DD UNIT=WORK,SPACE=(CYL,(5,1))
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(20:1,09,40:10,16)
OMIT COND=(19,2,CH,EQ,C’DT’)
/*
//* END OF JOB

 

You might also like to look at:

 

 

SORT – CONVERT PD to ZD and BI to ZD
SORT – EDIT FIRST AND LAST RECORD
SORT – EDIT MASK PATTERNS
SORT – EDIT NUMERIC FIELDS (I,T,S)
SORT – FINDREP, IFTHEN and INREC
SORT – How to use VB dataset (VLSHRT)
SORT – INCLUDE and OMIT
SORT – INREC, INCLUDE and OMIT
SORT – JUSTIFY, SQUEEZE and OVERLAY
SORT – LOOKUP AND CHANGE
SORT – OUTPUT DATASET DCB (LRECL,RECFM,BLKSIZE)
SORT – OUTREC – INSERT ZEROES, BLANKS, STRINGS
SORT – OUTREC – TRAN
SORT – PARSE – REFORMAT VARIABLE FIELDS
SORT – Process Order of CONTROL Statements
SORT – REMOVE DUPLICATES AND WRITE THEM TO XSUM
SORT – SET RETURN CODE ‘04’ IF OUTPUT FILE IS EMPTY
SORT – SKIPREC and STOPAFT
SORT – SUM FIELDS
SORT – TO REPLACE A CHAR WITH ANOTHER CHAR – ALTSEQ
SORT – INREC
SORT – SYMBOLS
SORT JOB – SIMPLE COPY
SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
SORT JOIN – UNPAIRED RECORDS INDICATOR


Advertisements