Sunday, 26 August 2012

ICETOOL examples


Following Figure shows the Normal Layout of a ICETOOL job:
BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.00              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*  --> This is where the ICETOOL messages go                                                
000004 //DFSMSG DD SYSOUT=*   --> This is where the DFSORT messages go                                                
000005 //TOOLIN DD *          --> This is where the ICETOOL operators are written                                                
000006 /*                                                                     
****** **************************** Bottom of Data ****************************

COPY Operator:
BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   COPY FROM(INPUT1) TO(OUTPUT) USING(CTL1)                             
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //OUTPUT DD DSN=SM017R.TCTF801.T5,DISP=(NEW,CATLG),                    
000010 //          DCB=(*.INPUT1)                                             
000011 //CTL1CNTL DD *                                                        
000012  INCLUDE COND=(1,1,CH,EQ,C'1')                                         
000013 /*                                                                     
****** **************************** Bottom of Data ****************************


COUNT OPERATOR:
BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   COUNT FROM(INPUT1) USING(CTL1)                                       
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //CTL1CNTL DD *                                                        
000010  INCLUDE COND=(1,1,CH,EQ,C'1')                                         
000011 /*                                                                     
****** **************************** Bottom of Data ****************************

By default COUNT operator will write the count in the TOOLMSG dataset.

BC00       SSO.D0354199.T012236.ICETOOL1                   Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 »                                                                      
000002  SYT000I  SYNCTOOL RELEASE 1.7.0 - COPYRIGHT 2008  SYNCSORT INC.       
000003  SYT001I  INITIAL PROCESSING MODE IS "STOP"                            
000004  SYT002I  "TOOLIN" INTERFACE BEING USED                                
000005                                                                        
000006             COUNT FROM(INPUT1) USING(CTL1)                             
000007  SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0001"                       
000008  SYT031I  NUMBER OF RECORDS PROCESSED: 000000000017159                 
000009  SYT030I  OPERATION COMPLETED WITH RETURN CODE 0                       
000010                                                                        
000011  SYT004I  SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 0             
****** **************************** Bottom of Data ****************************



BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   COUNT FROM(INPUT1) USING(CTL1) WRITE(COUNT) TEXT('COUNT IS:')        
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //COUNT  DD DSN=SM017R.TCTF801.COUNT,DISP=(NEW,CATLG),                 
000010 //          DCB=(RECFM=FB,LRECL=80)                                    
000011 //CTL1CNTL DD *                                                        
000012  INCLUDE COND=(1,1,CH,EQ,C'1')                                         
000013 /*                                                                     
****** **************************** Bottom of Data ****************************

WRITE is used write the count to a file instead of sending it to TOOLMSG.
TEXT is used to decide the text to be written before the count

BC00       SM017R.TCTF801.COUNT                            Columns 00001 00024
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
017159 COUNT IS:000000000017159                                               
****** **************************** Bottom of Data ****************************


We can use EMPTY,NOEMPTY,HIGHER,LOWER,EQUAL,NOT EQUAL to check the result of the counts and set a specific RC. By default when the criteria is matched the job ends with RC 12. In the below example the count is higher than 1000 and hence the job completes with RC 12.
BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   COUNT FROM(INPUT1) USING(CTL1) HIGHER(1000)                          
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //CTL1CNTL DD *                                                        
000010  INCLUDE COND=(1,1,CH,EQ,C'1')                                         
000011 /*                                                                     
****** **************************** Bottom of Data ****************************

Job Name   Nbr  MaxCC  Sys   Started     Ended     Lines Description 
ICETOOL1  9918  0012  EC00 12236/0423 12236/0423     131 ICETOOL TEST


We can use the RC4 option in case we want the step to return the RC of 04 when the criteria is met.(overriding 12) . We could use EMPTY criteria to check if the input file is empty . In such case the RC will be set to 12 or 04 and then we can decide the action in subsequent steps.
BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   COUNT FROM(INPUT1) USING(CTL1) HIGHER(1000) RC4                      
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //CTL1CNTL DD *                                                        
000010  INCLUDE COND=(1,1,CH,EQ,C'1')                                         
000011 /*                                                                     
****** **************************** Bottom of Data ****************************

Job Name   Nbr  MaxCC  Sys   Started     Ended     Lines Description  
ICETOOL1  9948  0004  EC00 12236/0424 12236/0424     129 ICETOOL TEST 


We can use ADD or SUB option to add - subtract a value of up to max 999 from the count. We could use this to compensate the header and trailer count.
BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   COUNT FROM(INPUT1) USING(CTL1) ADD(999)                              
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //CTL1CNTL DD *                                                        
000010  INCLUDE COND=(1,1,CH,EQ,C'1')                                         
000011 /*                                                                     
****** **************************** Bottom of Data ****************************

BC00       SSO.D0426291.T212236.ICETOOL1                   Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 »                                                                      
000002  SYT000I  SYNCTOOL RELEASE 1.7.0 - COPYRIGHT 2008  SYNCSORT INC.       
000003  SYT001I  INITIAL PROCESSING MODE IS "STOP"                            
000004  SYT002I  "TOOLIN" INTERFACE BEING USED                                
000005                                                                        
000006             COUNT FROM(INPUT1) USING(CTL1) ADD(999)                    
000007  SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0001"                       
000008  SYT031I  NUMBER OF RECORDS PROCESSED: 000000000018158                 
000009  SYT030I  OPERATION COMPLETED WITH RETURN CODE 0                       
000010                                                                        
000011  SYT004I  SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 0             
****** **************************** Bottom of Data ****************************



DATASORT operator:This is used to sort the file keeping the header -trailer in place.We can also select not to sort 1st few or last few records.
 BC00       SM017R.TCTF801.TEST                             Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR 
 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 ****** ***************************** Top of Data ******************************
 000001 1LSP20120818       Åd e@         *L25  07TX440292570RC    A2MCXX018323SW
 000002 1LSP20120818    <  Åd È@         ðL25  07TX440292570RC    A2MCXX000888SW
 000003 1LSP20120818   i   Åd  ð         %L25  07TX440292570RC    A2MCXX001675SW
 000004 1LSP20120818   f   Åc           ` L27  06TX440292570RC    A2MCXX001778SW
 000005 1LSP20120818   f   Åc             L27  07TX440292570RC    694586734    
 000006 1LSP20120818   f   Åc             L27  07TX440292570RC    A2MCXX001778SW
 000007 1LSP20120818   f   Åc            æL27  06TX440292570RC    694586719    
 000008 1LSP20120818   f   Åc             L27  07TX440292570RC    694586719    
 000009 1LSP20120818   f   Åc           Á L27  07TX440292570RC    A2MCXX001778SW
 000010 1LSP20120818  È    Åc Êæ        Ø L15  08TX442011440RC    A2MCXX011098SW
 000011 1LSP20120818  È    Åc Êæ          L15  08TX442011440RC    A2MCXX011098SW
 000012 1LSP20120818  Ìç*  Åd ñ%        Â%L25  07TX440292570RC    678291232


BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   DATASORT FROM(INPUT1) TO(OUTPUT) HEADER TRAILER USING(CTL1)          
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //OUTPUT DD DSN=SM017R.TCTF801.T6,DISP=(NEW,CATLG),                    
000010 //          DCB=*.INPUT1                                               
000011 //CTL1CNTL DD *                                                        
000012   SORT FIELDS=(59,4,CH,A)                                              
000013 /*                                                                     
****** **************************** Bottom of Data ****************************

BC00       SM017R.TCTF801.T6                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 1LSP20120818       Åd e@         *L25  07TX440292570RC    A2MCXX018323SW
000002 1LSP20120818    <  Åd È@         ðL25  07TX440292570RC    A2MCXX000888SW
000003 1LSP20120818   i   Åd  ð         %L25  07TX440292570RC    A2MCXX001675SW
000004 1LSP20120818   f   Åc           ` L27  06TX440292570RC    A2MCXX001778SW
000005 1LSP20120818   f   Åc             L27  07TX440292570RC    A2MCXX001778SW
000006 1LSP20120818   f   Åc           Á L27  07TX440292570RC    A2MCXX001778SW
000007 1LSP20120818  È    Åc Êæ        Ø L15  08TX442011440RC    A2MCXX011098SW
000008 1LSP20120818  È    Åc Êæ          L15  08TX442011440RC    A2MCXX011098SW
000009 1LSP20120818  Ìç*  Åd ñ%         @L25  07TX440292570RC    A2MCXX012569SW
000010 1LSP20120818  Øø%  Åd Â<         æL25  07TX440912110RC    A2MCXX013944SW
000011 1LSP2012081  Øø%  Åd Â<         æL25  07TX440912110RC    A2MCXX013944SW
000012 1LSP820120818  ØΠ  Åd             L25  07TX442012220RC    A2MCXX013979SW
000013 1LSP20120818  ØΠ  Åd           ä L25  07TX442012220RC    A2MCXX013979SW

Only the header and trailer kept in place and rest of the data is sorted.
If we have a header of 2 rows then write HEADER(2).
If we don’t want first and last 5 records not to be sorted then we should use FIRST(5) LAST(5).


DISPLAY Operator:Used to generate reports from input file. We can print titles, heading and also stats on different fields.
BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   DISPLAY FROM(INPUT1) LIST(OUTPUT) ON(59,6,CH) -                     
000007   TITLE('THIS IS A TEST TITLE LINE1') -                                
000008   TITLE('THIS IS A TEST TITLE LINE2')                                  
000009 /*                                                                     
000010 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000011 //OUTPUT DD DSN=SM017R.TCTF801.T9,DISP=(NEW,CATLG),                    
000012 //          DCB=*.INPUT1                                               
000013 //CTL1CNTL DD *                                                        
000014   INCLUDE COND=(1,1,EQ,C'9')                                           
000015 /*                                                                     
****** **************************** Bottom of Data ****************************

List indicates the output dataset.
ON indicates the fields to be displayed on the report.

Note that 1st column is occupied by the printing carriage control character.
We can turn off that display using NOCC.

 BC00       SM017R.TCTF801.T9                               Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR 
 ****** ***************************** Top of Data ******************************
 000001 1THIS IS A TEST TITLE LINE1                                            
 000002                                                                        
 000003  THIS IS A TEST TITLE LINE2                                            
 000004                                                                        
 000005  (59,6,CH)  --> We can use HEADER (upto 3 lines) to display header column                                                           
 000006  A2MCXX                                                                
 000007  A2MCXX                                                                
 000008  A2MCXX                                                                
 000009  A2MCXX                                                                
 000010  694586                                                                
 000011  A2MCXX                                                                
 000012  694586                                                                
 000013  694586                                                                
 000014  A2MCXX                                                                
 000015  A2MCXX                                                                
 000016  A2MCXX                                                                
 000017  678291                                                                
 000018  678291                                                                
 000019  A2MCXX                                                                
 000020  A2MCXX                                                                
 000021  514406                                                                

Note that only the column we mentioned in ON() is printed in the report.
Also note that both the titles are printed. '1' before "THIS IS A TEST TITLE LINE1". Is for formatting purpose.

BC00       SM017R.TCTF801.T9                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
000052  504837                                                                
000053  A2MCXX                                                                
000054  A2MCXX                                                                
000055  100012                                                                
000056  A2MCXX                                                                
000057  A2MCXX                                                                
000058  805083                                                                
000059 1THIS IS A TEST TITLE LINE1                                            
000060                                                                        
000061  THIS IS A TEST TITLE LINE2                                            
000062                                                                        
000063  (59,6,CH)                                                             
000064  805083                                                                
000065  593912                                                                
000066  A2MCXX                                                                
000067  A2MCXX                                                                
000068  593912                                                                
000069  593912                                                                
000070  A2MCXX                                                                
000071  A2MCXX                                                                
000072  A2MCXX                                                                
000073  593912                                                                

Also note that in the above figure the title is being printed every page.
We can use TFIRST to print the title only on 1st page.
TLEFT to print the title left justified.

We can specify NOCC to override default of printing carriage control characters.




BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   DISPLAY FROM(INPUT1) LIST(OUTPUT)    -                               
000007   TITLE('THIS IS A TEST TITLE LINE1') DATE - we can also print date,time,page on the 1st title line.                          
000008   TITLE('THIS IS A TEST TITLE LINE2') TFIRST TLEFT -                   
000009   HEADER('COLUMN1') ON(59,6,CH) -                                      
000010   HEADER(NONE)  ON(5,8,CH) --> Use NONE if we don’t want header.                                            
000011 /*                                                                     
000012 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000013 //OUTPUT DD DSN=SM017R.TCTF801.T9,DISP=(OLD,CATLG),                    
000014 //          DCB=*.INPUT1                                               
000015 //CTL1CNTL DD *                                                        
000016   INCLUDE COND=(1,1,EQ,C'9')                                           
000017 /*                                                                     
****** **************************** Bottom of Data ****************************
                                                                              

BC00       SM017R.TCTF801.T9                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data *****************************
000001 1THIS IS A TEST TITLE LINE1        08/24/12                           
000002                                                                       
000003  THIS IS A TEST TITLE LINE2                                           
000004                                                                       
000005  COLUMN1                                                              
000006  --------------------                                                 
000007  A2MCXX                 20120818                                      
000008  A2MCXX                 20120818                                      
000009  A2MCXX                 20120818                                      
000010  A2MCXX                 20120818                                      
000011  694586                 20120818                                      
000012  A2MCXX                 20120818                                      
000013  694586                 20120818                                      
000014  694586                 20120818                                      
000015  A2MCXX                 20120818                                      
000016  A2MCXX                 20120818                                      
000017  A2MCXX                 20120818                                      
000018  678291                 20120818                                      
000019  678291                 20120818                                      
000020  A2MCXX                 20120818                                      
000021  A2MCXX                 20120818                                      



BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   DISPLAY FROM(INPUT1) LIST(OUTPUT)    -                               
000007   TITLE('THIS IS A TEST TITLE LINE1') DATE -                           
000008   TITLE('THIS IS A TEST TITLE LINE2') TFIRST TLEFT -                   
000009   HEADER(NONE)  ON(5,8,ZD)  -                                          
000010   TOTAL('TOTAL') -                                                     
000011   AVERAGE('AVERAGE') -                                                 
000012   MAXIMUM('MAXIMUM') -                                                 
000013   MINIMUM('MINIMUM') -                                                 
000014   COUNT('COUNT IS ')                                                   
000015 /*                                                                     
000016 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000017 //OUTPUT DD DSN=SM017R.TCTF801.T9,DISP=(OLD,CATLG),                    
000018 //          DCB=*.INPUT1                                               
000019 //CTL1CNTL DD *                                                        
000020   INCLUDE COND=(1,1,EQ,C'9')                                           
000021 /*                                                                     

TOTAL, MAXIMUM,MINIMUM,AVERAGE,COUNT is used to display the stats of the columns mentioned in the ON parameters. The string within () is also printed before the value is printed.

BC00       SM017R.TCTF801.T9                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
017158  +000000020120818                                                      
017159  +000000020120818                                                      
017160  +000000020120818                                                      
017161  +000000020120818                                                      
017162  +000000020120818                                                      
017163  +000000020120818                                                      
017164  +000000048000003                                                      
017165                                                                        
017166  TOTAL                                                                 
017167  +000345293340926                                                      
017168                                                                        
017169  AVERAGE                                                               
017170  +000000020121989                                                      
017171                                                                        
017172  MAXIMUM                                                               
017173  +000000048000003                                                      
017174                                                                        
017175  MINIMUM                                                               
017176  +000000012345679                                                      
017177                                                                        
017178  COUNT IS 000000000017160                                              
****** **************************** Bottom of Data ****************************


BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data *****************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                  
000002 //TOOL     EXEC PGM=ICETOOL                                           
000003 //TOOLMSG DD SYSOUT=*                                                 
000004 //DFSMSG DD SYSOUT=*                                                  
000005 //TOOLIN DD *                                                         
000006   DISPLAY FROM(INPUT1) LIST(OUTPUT)    -                              
000007   PAGE TITLE('THIS IS A TEST TITLE LINE1') DATE TIME -                
000008   TITLE('THIS IS A TEST TITLE LINE2') TFIRST TLEFT - title left justified and printed only on 1st line                 
000009   HEADER(NONE)  ON(5,8,ZD)  -                                         
000010   HEADER(NONE) ON(59,5,CH) -                                          
000011   HEADER(NONE) ON(36,2,ZD) -                                          
000012   BETWEEN(10) -    --> indicates the space between columns                                                  
000013   STATLEFT -                                                          
000014   BREAK(36,2,CH) -                                                  
000015   BTITLE('DIVISION') -                                                
000016   BTOTAL('DIVTOT') -                                                  
000017   BMINIMUM('DIVMINI') -                                               
000018   BMAXIMUM('DIVMAX') -                                                
000019   BCOUNT('DIVCNT') -                                                  
000020   BAVERAGE('DIVAVG') -                                                
000021   TOTAL('TOTAL') -                                                    
000022   AVERAGE('AVERAGE') -                                                 
000023   MAXIMUM('MAXIMUM') -                                                 
000024   MINIMUM('MINIMUM') -                                                 
000025   COUNT('COUNT IS ')                                                   
000026 /*                                                                     
000027 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000028 //OUTPUT DD DSN=SM017R.TCTF801.T9,DISP=(OLD,CATLG),                    
000029 //          DCB=*.INPUT1                                               
000030 //CTL1CNTL DD *                                                        
000031   INCLUDE COND=(1,1,EQ,C'9')                                           
000032 /*                                                                     
****** **************************** Bottom of Data ****************************

The column in the BREAK is used to create sections in the report. (its advised to have data sorted on this column). We can use BMAXIMUM,BMINIMUM,BAVERAGE,BTOTAL to display stats for each section.

This is somewhat similar to WITH and WITH BY option used in teradata.


OCCUR operator:Count the occurrences of each of values in the columns specified in the ON.If multiple ON are specified then all columns are used to identify the occurrences.
BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   OCCUR  FROM(INPUT1) LIST(OUTPUT) ON(5,8,ZD)                          
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //OUTPUT DD DSN=SM017R.TCTF801.T3,DISP=(OLD,CATLG),                    
000010 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

ON indicates the column for which unique must be found.

BC00       SM017R.TCTF801.T3                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 1(5,8,ZD)                                                              
000002  +000000012345679                                                      
000003  +000000020120818                                                      
000004  +000000048000003                                                      
****** **************************** Bottom of Data ****************************

Above shows the unique values in the column 5,8,ZD.





We can use ON(VALCNT) to print the count of each of the unique values.

BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   OCCUR  FROM(INPUT1) LIST(OUTPUT) ON(5,8,ZD) ON(VALCNT)               
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //OUTPUT DD DSN=SM017R.TCTF801.T3,DISP=(OLD,CATLG),                    
000010 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

ON(VALCNT) should be used to give us the count of the each unique columns

BC00       SM017R.TCTF801.T3                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 1(5,8,ZD)           VALUE COUNT                                        
000002  +000000012345679   000000000000001                                    
000003  +000000020120818   000000000017158                                    
000004  +000000048000003   000000000000001                                    
****** **************************** Bottom of Data ****************************



BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   OCCUR  FROM(INPUT1) LIST(OUTPUT) ON(5,8,ZD) ON(35,3,CH) ON(VALCNT)   
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //OUTPUT DD DSN=SM017R.TCTF801.T3,DISP=(OLD,CATLG),                    
000010 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

More column we add it prints the unique value for the combination and the VALCNT also prints the unique values of the combination.Its like select (5,8,zd),(35,3,CH),count(*) from INPUT1 GROUP by 1,2
 BC00       SM017R.TCTF801.T3                               Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR 
 ****** ***************************** Top of Data ******************************
 000001 1(5,8,ZD)           (35,3,CH)              VALUE COUNT                 
 000002  +000000012345679   L25                    000000000000001             
 000003  +000000020120818   L01                    000000000000265             
 000004  +000000020120818   L02                    000000000000632             
 000005  +000000020120818   L03                    000000000000514             
 000006  +000000020120818   L04                    000000000000199             
 000007  +000000020120818   L05                    000000000000958             
 000008  +000000020120818   L06                    000000000000332             
 000009  +000000020120818   L07                    000000000000323             
 000010  +000000020120818   L08                    000000000000155             
 000011  +000000020120818   L09                    000000000000150             
 000012  +000000020120818   L10                    000000000000216             
 000013  +000000020120818   L11                    000000000001476             
 000014  +000000020120818   L12                    000000000000152             
 000015  +000000020120818   L13                    000000000000209             
 000016  +000000020120818   L14                    000000000000150             
 000017  +000000020120818   L15                    000000000000228             
 000018  +000000020120818   L16                    000000000000131             
 000019  +000000020120818   L17                    000000000000301             
 000020  +000000020120818   L18                    000000000000118             


Note that OCCUR also has reporting features like DISPLAY.

BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   OCCUR FROM(INPUT1) LIST(OUTPUT) -                                    
000007   DATE TIME PAGE TITLE('DUPLICATE REPORT') -                           
000008   HEADER('ABC') ON(35,3,CH) -                                          
000009   HEADER('COUNT')  ON(VALCNT)                                          
000010 /*                                                                     
000011 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000012 //OUTPUT DD DSN=SM017R.TCTF801.T3,DISP=(OLD,CATLG),                    
000013 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

BC00       SM017R.TCTF801.T3                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 108/25/12        07:03:00        - 1 -        DUPLICATE REPORT         
000002                                                                        
000003  ABC                              COUNT                                
000004  --------------------   ---------------                                
000005  L01                    000000000000265                                
000006  L02                    000000000000632                                
000007  L03                    000000000000514                                
000008  L04                    000000000000199                                
000009  L05                    000000000000958                                
000010  L06                    000000000000332                                
000011  L07                    000000000000323                                
000012  L08                    000000000000155                                
000013  L09                    000000000000150                                
000014  L10                    000000000000216                                
000015  L11                    000000000001476                                
000016  L12                    000000000000152                                
000017  L13                    000000000000209                                
000018  L14                    000000000000150                                
000019  L15                    000000000000228                                
000020  L16                    000000000000131                                
000021  L17                    000000000000301                                



See the impact of using BLANK:
BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   OCCUR FROM(INPUT1) LIST(OUTPUT) -                                    
000007   DATE TIME PAGE TITLE('DUPLICATE REPORT') -                           
000008   HEADER('ABC') ON(35,3,CH) BLANK -                                    
000009   HEADER('COUNT')  ON(VALCNT)                                          
000010 /*                                                                     
000011 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000012 //OUTPUT DD DSN=SM017R.TCTF801.T3,DISP=(OLD,CATLG),                    
000013 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

BLANK replaces all the leading zeros.

BC00       SM017R.TCTF801.T3                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 108/25/12        07:06:46        - 1 -        DUPLICATE REPORT         
000002                                                                        
000003  ABC             COUNT                                                 
000004  ---   ---------------                                                 
000005  L01               265                                                 
000006  L02               632                                                 
000007  L03               514                                                 
000008  L04               199                                                 
000009  L05               958                                                 
000010  L06               332                                                 
000011  L07               323                                                 
000012  L08               155                                                 
000013  L09               150                                                 
000014  L10               216                                                 
000015  L11              1476                                                 
000016  L12               152                                                 
000017  L13               209                                                 
000018  L14               150                                                 
000019  L15               228                                                 
000020  L16               131                                                 
000021  L17               301                                                 


BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   OCCUR FROM(INPUT1) LIST(OUTPUT) ON(35,3,CH) ON(VALCNT) NODUPS        
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //OUTPUT DD DSN=SM017R.TCTF801.T3,DISP=(OLD,CATLG),                    
000010 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

BC00       SM017R.TCTF801.T3                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 1(35,3,CH)              VALUE COUNT                                    
000002  000                    000000000000001                                
****** **************************** Bottom of Data ****************************

NODUPS prints only the value that are unique.
That is the values that appear only once.


BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   OCCUR FROM(INPUT1) LIST(OUTPUT) ON(35,3,CH) ON(VALCNT) ALLDUPS       
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //OUTPUT DD DSN=SM017R.TCTF801.T3,DISP=(OLD,CATLG),                    
000010 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

BC00       SM017R.TCTF801.T3                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 1(35,3,CH)              VALUE COUNT                                    
000002  L01                    000000000000265                                
000003  L02                    000000000000632                                
000004  L03                    000000000000514                                
000005  L04                    000000000000199                                
000006  L05                    000000000000958                                
000007  L06                    000000000000332                                
000008  L07                    000000000000323                                
000009  L08                    000000000000155                                
000010  L09                    000000000000150                                
000011  L10                    000000000000216                                
000012  L11                    000000000001476                                
000013  L12                    000000000000152                                
000014  L13                    000000000000209                                
000015  L14                    000000000000150                                
000016  L15                    000000000000228                                
000017  L16                    000000000000131                                
000018  L17                    000000000000301                                
000019  L18                    000000000000118                                
000020  L19                    000000000000084                                
000021  L20                    000000000000110                                

This prints the values that occur more than once. The ones that occur only 1 time are not printed.

We can use ALLDUPS,NODUPS,HIGHER,LOWER or EQUAL to print the values whose occurrences match the criteria specified.

Below prints the values that occur more than 500 times.

BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data *****************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                  
000002 //TOOL     EXEC PGM=ICETOOL                                           
000003 //TOOLMSG DD SYSOUT=*                                                 
000004 //DFSMSG DD SYSOUT=*                                                  
000005 //TOOLIN DD *                                                         
000006   OCCUR FROM(INPUT1) LIST(OUTPUT) ON(35,3,CH) ON(VALCNT) HIGHER(500)  
000007 /*                                                                    
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                          
000009 //OUTPUT DD DSN=SM017R.TCTF801.T3,DISP=(OLD,CATLG),                   
000010 //          DCB=*.INPUT1                                              
****** **************************** Bottom of Data ***************************

BC00       SM017R.TCTF801.T3                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 1(35,3,CH)              VALUE COUNT                                    
000002  L02                    000000000000632                                
000003  L03                    000000000000514                                
000004  L05                    000000000000958                                
000005  L11                    000000000001476                                
000006  L25                    000000000006193                                
000007  L26                    000000000002041                                
000008  L27                    000000000000840                                
****** **************************** Bottom of Data ****************************

Prints the values that occur more than 500 times.




In the ON clause we can specify the format in which data will be displayed . We could any of the existing masks.
A0,A1-A5,B1-B6,C1-C6,D1-D6,E1-E4,F1-f6 etc.

Note the format is decided as follows:

Character Data: CH
Numeric with data usage is DISPLAY: ZD
Numeric fields with usage COMP: BI(binary)
Numeric fields with usage COMP-3: PD(packed decimal)

BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   OCCUR FROM(INPUT1) LIST(OUTPUT) -                                    
000007   ON(5,8,ZD) -                                                         
000008   ON(5,8,ZD,A1) -                                                      
000009   ON(5,8,ZD,B1) -                                                      
000010   ON(5,8,ZD,C1) -                                                      
000011   ON(5,8,ZD,D1) -                                                      
000012   ON(5,8,ZD,E1) -                                                      
000013   ON(5,8,ZD,F1) -                                                      
000014   ON(5,8,ZD,G1) -                                                      
000015   ON(VALCNT) HIGHER(500)                                               
000016 /*                                                                     
000017 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000018 //OUTPUT DD DSN=SM017R.TCTF801.T3,DISP=(OLD,CATLG),                    
000019 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

BC00       SM017R.TCTF801.T3                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 1 (5,8,ZD)      (5,8,ZD)       (5,8,ZD)      (5,8,ZD)      (5,8,ZD)    
000002   20120818    20,120,818    2,012,081.8    201,208.18    20,120.818    2
****** **************************** Bottom of Data ****************************
801.T3                               Columns 00058 00129
                                        Scroll ===> CSR 
************** Top of Data ******************************
  (5,8,ZD)       (5,8,ZD)      (5,8,ZD)       VALUE COUNT
0,120,818     201,208.18     2,012.0818             17158
************* Bottom of Data ****************************

See the Use of Edit patterns.



RANGE OPERATOR:Used to find the number of records having a field value within in a range.
BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   RANGE FROM(INPUT1) ON(36,2,ZD) HIGHER(26)                            
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //OUTPUT DD DSN=SM017R.TCTF801.T3,DISP=(OLD,CATLG),                    
000010 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

This displays the count of records having field 36,2,ZD greater than 26.

 BC00       SSO.D1302507.T812238.ICETOOL1                   Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR 
 ****** ***************************** Top of Data ******************************
 000001 »                                                                      
 000002  SYT000I  SYNCTOOL RELEASE 1.7.0 - COPYRIGHT 2008  SYNCSORT INC.       
 000003  SYT001I  INITIAL PROCESSING MODE IS "STOP"                            
 000004  SYT002I  "TOOLIN" INTERFACE BEING USED                                
 000005                                                                        
 000006             RANGE FROM(INPUT1) ON(36,2,ZD) HIGHER(26)                  
 000007  SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0001"                       
 000008  SYT031I  NUMBER OF RECORDS PROCESSED: 000000000017160                 
 000009  SYT032I  NUMBER OF RECORDS IN RANGE: 000000000001267                  
 000010  SYT030I  OPERATION COMPLETED WITH RETURN CODE 0                       
 000011                                                                        
 000012  SYT004I  SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 0             
 ****** **************************** Bottom of Data ****************************

Prints the number of records with value greater than 26. which is 1267.



SELECT operator:
Following can be used to remove duplicates from a file and save it to another file.

BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.01              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   SELECT FROM(INPUT1) TO(OUTPUT) ON(44,11,CH) NODUPS                   
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //OUTPUT DD DSN=SM017R.TCTF801.T3,DISP=(OLD,CATLG),                    
000010 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

All unique records will be copied to another datasets

BC00       SM017R.TCTF801.T3                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
000693 1LSP20120818 ÅmÁ   Åe`ê%        °*L26  07WI501331410RC    2210265597   
000694 1LSP20120818 ol    Åf             L13  08WI501390850RC    2576338105   
****** **************************** Bottom of Data ****************************




STATS Operator:This shows stats like maximum ,minimum, average , count ,total of a particular field(s). This message is shown in the TOOLMSG dataset.
BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.02              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   STATS FROM(INPUT1) ON(36,2,ZD)                                       
000007 /*                                                                     
000008 //INPUT1 DD DSN=SM017R.TCTF801.TEST,DISP=SHR                           
000009 //OUTPUT DD DSN=SM017R.TCTF801.T3,DISP=(OLD,CATLG),                    
000010 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

BC00       SSO.D1543126.T812238.ICETOOL1                   Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 »                                                                      
000002  SYT000I  SYNCTOOL RELEASE 1.7.0 - COPYRIGHT 2008  SYNCSORT INC.       
000003  SYT001I  INITIAL PROCESSING MODE IS "STOP"                            
000004  SYT002I  "TOOLIN" INTERFACE BEING USED                                
000005                                                                        
000006             STATS FROM(INPUT1) ON(36,2,ZD)                             
000007  SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0001"                       
000008  SYT031I  NUMBER OF RECORDS PROCESSED: 000000000017160                 
000009  SYT035I  STATISTICS FOR FIELD (00036,002,ZD) -                        
000010  SYT036I       MINIMUM: +0000000000000000000000000000000               
000011  SYT037I       MAXIMUM: +0000000000000000000000000000029               
000012  SYT038I       AVERAGE: +0000000000000000000000000000018               
000013  SYT039I       TOTAL  : +0000000000000000000000000321441               
000014  SYT030I  OPERATION COMPLETED WITH RETURN CODE 0                       
000015                                                                        
000016  SYT004I  SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 0             
****** **************************** Bottom of Data ****************************






SUBSET Operator:Used to extract portion of one file and copy it to another file.We can use record numbers to indicate which records to copy.
BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.02              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   SUBSET FROM(INPUT1) TO(OUTPUT) KEEP INPUT RRN(100,200)               
000007 /*                                                                     
000008 //INPUT1 DD DSN=DWPC.DW510.BBNMS.DATA01.G1674V00,DISP=SHR              
000009 //OUTPUT DD DSN=SM017R.BBNMS01.T3,DISP=(NEW,CATLG),                    
000010 //          DCB=*.INPUT1                                               

****** **************************** Bottom of Data ****************************

Above means keep the records from input file from record numbers 100 to 200.
We can also decide to remove the range using the word REMOVE

BC00       SM017R.BBNMS01.T3                               Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
000092 120569508|~|409388350|~|433762818|~|PR|~|AM|~|409388352C|~|20120822|~|20
000093 120926765|~|436900277|~|436900279|~|PR|~|NA|~|436900279A|~|20120905|~|20
000094 118848724|~|436900819|~|436900821|~|RS|~|NA|~|436900821A|~|20120822|~|20
000095 120647461|~|429422311|~|436900497|~|PR|~|CA|~|429422313D|~|20120822|~|20
000096 110306600|~|433658042|~|433658044|~|CH|~|NA|~|433658044A|~|20120823|~|20
000097 107547042|~|436900815|~|436900817|~|RS|~|NA|~|436900817A|~|20120822|~|20
000098 120768995|~|432960435|~|436900049|~|PR|~|AM|~|432960437C|~|20120822|~|20
000099 120596306|~|428041099|~|436900531|~|PR|~|AM|~|428041101H|~|20120827|~|20
000100 118808111|~|436900807|~|436900809|~|RS|~|NA|~|436900809A|~|20120822|~|20
000101 118911473|~|436900437|~|436900439|~|CH|~|NA|~|436900439A|~|20120822|~|20
****** **************************** Bottom of Data ****************************


BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.02              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   SUBSET FROM(INPUT1) TO(OUTPUT) REMOVE INPUT RRN(100,6220504)         
000007 /*                                                                     
.JCPA  //INPUT1 DD DSN=DWPC.DW510.BBNMS.DATA01.G1674V00,DISP=SHR              
000009 //OUTPUT DD DSN=SM017R.BBNMS01.T3,DISP=(OLD,CATLG),                    
000010 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

This will copy records from 1 to 99 and then the last record. This giving us a sample records for testing.


Unique Operator:

BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.02              Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
000002 //TOOL     EXEC PGM=ICETOOL                                            
000003 //TOOLMSG DD SYSOUT=*                                                  
000004 //DFSMSG DD SYSOUT=*                                                   
000005 //TOOLIN DD *                                                          
000006   UNIQUE FROM(INPUT1) ON(60,8,CH)                                      
000007 /*                                                                     
000008 //INPUT1 DD DSN=DWPC.DW510.BBNMS.DATA01.G1674V00,DISP=SHR              
000009 //OUTPUT DD DSN=SM017R.BBNMS01.T3,DISP=(OLD,CATLG),                    
000010 //          DCB=*.INPUT1                                               
****** **************************** Bottom of Data ****************************

As shown below it provides the number of unique values in the TOOLMSG.

BC00       SSO.D0202361.T312239.ICETOOL1                   Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 »                                                                      
000002  SYT000I  SYNCTOOL RELEASE 1.7.0 - COPYRIGHT 2008  SYNCSORT INC.       
000003  SYT001I  INITIAL PROCESSING MODE IS "STOP"                            
000004  SYT002I  "TOOLIN" INTERFACE BEING USED                                
000005                                                                        
000006             UNIQUE FROM(INPUT1) ON(60,8,CH)                            
000007  SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0001"                       
000008  SYT031I  NUMBER OF RECORDS PROCESSED: 000000006220505                 
000009  SYT034I  NUMBER OF UNIQUE RECORDS: 000000000000059                    
000010  SYT030I  OPERATION COMPLETED WITH RETURN CODE 0                       
000011                                                                        
000012  SYT004I  SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 0             
****** **************************** Bottom of Data ****************************




Below shows that we can use multiple operators together:
 BC00       SM017R.TEST1.JCL(ICETOOL1) - 01.02              Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR 
 ****** ***************************** Top of Data ******************************
 000001 //ICETOOL1 JOB (EWDS),'ICETOOL TEST'                                   
 000002 //TOOL     EXEC PGM=ICETOOL                                            
 000003 //TOOLMSG DD SYSOUT=*                                                  
 000004 //DFSMSG DD SYSOUT=*                                                   
 000005 //TOOLIN DD *                                                          
 000006   COUNT FROM(INPUT1)                                                   
 000007   UNIQUE FROM(INPUT1) ON(60,8,CH)                                      
 000008 /*                                                                     
 000009 //INPUT1 DD DSN=SM017R.BBNMS01.T3,DISP=SHR                             
 ****** **************************** Bottom of Data ****************************

BC00       SSO.D0401015.T012239.ICETOOL1                   Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 »                                                                      
000002  SYT000I  SYNCTOOL RELEASE 1.7.0 - COPYRIGHT 2008  SYNCSORT INC.       
000003  SYT001I  INITIAL PROCESSING MODE IS "STOP"                            
000004  SYT002I  "TOOLIN" INTERFACE BEING USED                                
000005                                                                        
000006             COUNT FROM(INPUT1)                                         
000007  SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0001"                       
000008  SYT031I  NUMBER OF RECORDS PROCESSED: 000000000000100                 
000009  SYT030I  OPERATION COMPLETED WITH RETURN CODE 0                       
000010                                                                        
000011             UNIQUE FROM(INPUT1) ON(60,8,CH)                            
000012  SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0002"                       
000013  SYT031I  NUMBER OF RECORDS PROCESSED: 000000000000100                 
000014  SYT034I  NUMBER OF UNIQUE RECORDS: 000000000000011                    
000015  SYT030I  OPERATION COMPLETED WITH RETURN CODE 0                       
000016                                                                        
000017  SYT004I  SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 0             
****** **************************** Bottom of Data ****************************

3 comments:

  1. With this concrete samples, I got my ICETOOL-Jobs work.
    Thanx a lot
    Wolfgang

    ReplyDelete
  2. Wonderful examples...
    I learnt ICETOOL.
    Thank you so much.

    ReplyDelete