ICETOOL Count

Below step will get the number of records present in IN1 and IN2 files. The counts will be displayed in TOOLMSG DD. This will come handy, when you need to get count of big files and you have so many files to check the count.

//STEP01 EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//IN1 DD DSN=MY.DSN.ONE,DISP=SHR
//IN2 DD DSN=MY.DSN.TWO,DISP=SHR
//TOOLIN DD *
 COUNT FROM(IN1)
 COUNT FROM(IN2)

Sort Card examples (IBM Mainframes)

Avoid duplicates in a particular field (say first 8 characters)

SORT FIELDS=(1,8,CH,A)
SUM FIELDS=NONE

Sort first 8 characters, and omit few values

SORT FIELDS=(1,8,CH,A)
OMIT COND=(1,8,CH,EQ,C'AAAAAAAA')

Sort first 8 characters, and include only few values

SORT FIELDS=(1,8,CH,A)
INCLUDE COND=(1,8,CH,EQ,C'AAAAAAAA',OR, 1,8,CH,EQ,C'BBBBBBBB')

Sort card to select only 15 characters from 36th position of my input file.

//SORTSTEP  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DISP=SHR,
//            DSN=MYDSN.NAME
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,2000)
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,2000)
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,2000)
//SYSIN    DD *
 SORT FIELDS=COPY
 OUTFIL CONVERT,
 OUTREC=(1:36,15,65X)
/*
//SORTOUT  DD DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(250,100),RLSE),
//            UNIT=DISK,
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),
//            DSN=MYDSN.OUTPUT.NAME

The 65X is given to fill the remaining 65 bytes of the output file with spaces.