I am using below SORT job to count different occurences of input records on different criteria and successfully getting the results.........
//STEP0001 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//SSMSG DD SYSOUT=*
//IN1 DD *
ABCD1111
BCDE2222
CDEF3333
//OUT1 DD DSN=&&TEMP1,SPACE=(TRK,(1,1),RLSE),DISP=(NEW,PASS,DELETE)
//TOOLIN DD *
COPY FROM(IN1) TO(OUT1) USING(SAM1)
COUNT FROM(OUT1)
COPY FROM(IN1) TO(OUT1) USING(SAM2)
COUNT FROM(OUT1)
/*
//SAM1CNTL DD *
INCLUDE COND=(5,1,CH,EQ,C'1')
/*
//SAM2CNTL DD *
INCLUDE COND=(5,1,CH,EQ,C'2')
/*
//TOOLMSG DD SYSOUT=*
//SSMSG DD SYSOUT=*
//IN1 DD *
ABCD1111
BCDE2222
CDEF3333
//OUT1 DD DSN=&&TEMP1,SPACE=(TRK,(1,1),RLSE),DISP=(NEW,PASS,DELETE)
//TOOLIN DD *
COPY FROM(IN1) TO(OUT1) USING(SAM1)
COUNT FROM(OUT1)
COPY FROM(IN1) TO(OUT1) USING(SAM2)
COUNT FROM(OUT1)
/*
//SAM1CNTL DD *
INCLUDE COND=(5,1,CH,EQ,C'1')
/*
//SAM2CNTL DD *
INCLUDE COND=(5,1,CH,EQ,C'2')
/*
Output:
SYT001I INITIAL PROCESSING MODE IS "STOP"
SYT002I "TOOLIN" INTERFACE BEING USED
COPY FROM(IN1) TO(OUT1) USING(SAM1)
SYT020I SYNCSORT CALLED WITH IDENTIFIER "0001"
SYT030I OPERATION COMPLETED WITH RETURN CODE 0
COUNT FROM(OUT1)
SYT020I SYNCSORT CALLED WITH IDENTIFIER "0002"
SYT031I NUMBER OF RECORDS PROCESSED: 000000000000001
SYT030I OPERATION COMPLETED WITH RETURN CODE 0
COPY FROM(IN1) TO(OUT1) USING(SAM2)
SYT020I SYNCSORT CALLED WITH IDENTIFIER "0003"
SYT030I OPERATION COMPLETED WITH RETURN CODE 0
COUNT FROM(OUT1)
SYT020I SYNCSORT CALLED WITH IDENTIFIER "0004"
SYT031I NUMBER OF RECORDS PROCESSED: 000000000000001
SYT030I OPERATION COMPLETED WITH RETURN CODE 0
SYT004I SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 0
SYT002I "TOOLIN" INTERFACE BEING USED
COPY FROM(IN1) TO(OUT1) USING(SAM1)
SYT020I SYNCSORT CALLED WITH IDENTIFIER "0001"
SYT030I OPERATION COMPLETED WITH RETURN CODE 0
COUNT FROM(OUT1)
SYT020I SYNCSORT CALLED WITH IDENTIFIER "0002"
SYT031I NUMBER OF RECORDS PROCESSED: 000000000000001
SYT030I OPERATION COMPLETED WITH RETURN CODE 0
COPY FROM(IN1) TO(OUT1) USING(SAM2)
SYT020I SYNCSORT CALLED WITH IDENTIFIER "0003"
SYT030I OPERATION COMPLETED WITH RETURN CODE 0
COUNT FROM(OUT1)
SYT020I SYNCSORT CALLED WITH IDENTIFIER "0004"
SYT031I NUMBER OF RECORDS PROCESSED: 000000000000001
SYT030I OPERATION COMPLETED WITH RETURN CODE 0
SYT004I SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 0
Would you please let me know if my approach is right or wrong?
Is there any scope for betterment of this SORT job?
Please suggest.
Thanks.