Page 1 of 1

Count using SYNCTOOL

PostPosted: Fri Oct 03, 2008 9:26 pm
by ranga_subham
Hi,

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')                                         
/*


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 


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.

Re: Count using SYNCTOOL

PostPosted: Tue Oct 14, 2008 10:31 pm
by Alissa Margulies
Is this related to the thread below?
syncsort-synctool/topic1124.html

Re: Count using SYNCTOOL

PostPosted: Wed Oct 15, 2008 10:11 am
by ranga_subham
Alissa, the one you referred had only one condition. But, here need to count based on several conditions.

Thanks.

Re: Count using SYNCTOOL

PostPosted: Wed Oct 15, 2008 7:56 pm
by Alissa Margulies
Then the same logic applies. If you want a total count when (5,1) is 1 or 2, then code your INCLUDE statement with the 'OR' condition. If you need separate counts for when (5,1) equals 1 and when (5,1) equals 2, then code 2 separate OUTFIL statements each with the corresponding INCLUDE statement.

Re: Count using SYNCTOOL

PostPosted: Wed Oct 15, 2008 8:57 pm
by ranga_subham
I think you are suggesting to do like below:

//STEP0001 EXEC PGM=SYNCTOOL               
//TOOLMSG  DD SYSOUT=*                     
//SSMSG    DD SYSOUT=*                     
//IN1      DD *                             
ABCD1111                                   
BCDE2222                                   
CDEF3333                                   
//OUT1     DD SYSOUT=*                     
//OUT2     DD SYSOUT=*                     
//TOOLIN   DD *                             
 COPY FROM(IN1) TO(OUT1) USING(SAM1)       
 COPY FROM(IN1) TO(OUT2) USING(SAM2)       
/*                                         
//SAM1CNTL DD *                             
 OUTFIL FNAMES=OUT1,INCLUDE=(5,1,CH,EQ,C'1')
/*                                         
//SAM2CNTL DD *                             
 OUTFIL FNAMES=OUT2,INCLUDE=(5,1,CH,EQ,C'2')
/*                                         


Look for the below statements in the SSMSG:

WER405I  OUT1     :  DATA RECORDS OUT          1; TOTAL RECORDS OUT          1
WER405I  OUT2     :  DATA RECORDS OUT          1; TOTAL RECORDS OUT          1


Isn't it?

Thanks.

Re: Count using SYNCTOOL

PostPosted: Wed Oct 15, 2008 9:10 pm
by Alissa Margulies
No, that is your original solution. I was talking about the same logic in the other thread, using PGM=SORT, not SYNCTOOL.

Re: Count using SYNCTOOL

PostPosted: Tue Aug 18, 2009 10:06 am
by sricsc
Hi ,

I dont know how to use SYNCTOOL. Can anyone give the syntax or link for the synctool manual. Thanks.