Page 1 of 1

COUNT and SYSIN

PostPosted: Tue Feb 19, 2019 5:25 pm
by samb01
Hello,

i would like to get the line's numbre of a dataset and use it in a sysin :


//VERIFLNA EXEC PGM=ICETOOL                  
//TOOLMSG DD SYSOUT=*                        
//DFSMSG DD SYSOUT=*                          
//INDD DD DISP=SHR,DSN=DATASET.NOTEQUAL  
//TOOLIN DD            
COUNT FROM(INDD) NOTEQUAL(58)            

 


The number 58 is the number of line of this dataset : DATASET.NUMBER

Thank's for your help.

Re: COUNT and SYSIN

PostPosted: Tue Feb 19, 2019 5:36 pm
by Garry F Carroll
The number 58 is the number of line of this dataset : DATASET.NUMBER


This is unclear. Is 58 a number that is in a record of DATASET.NUMBER or the number of records in DATASET.NUMBER ?

Are you looking to dynamically create the control card
COUNT FROM(INDD) NOTEQUAL(58)
based on the number from DATASET.NUMBER ?

Garry.

Re: COUNT and SYSIN

PostPosted: Tue Feb 19, 2019 6:25 pm
by samb01
Hello, sorry for my english.
58 is the number of records in DATASET.NUMBER

i 'd like to get this number in the next sysin :


COUNT FROM(INDD) NOTEQUAL(number of records of the dataset : DATASET.NUMBER)
 

Re: COUNT and SYSIN

PostPosted: Tue Feb 19, 2019 8:13 pm
by Garry F Carroll
If you use ICETOOL to COUNT the records in DATASET.NUMBER and put the output to (temporary) dataset, you can use this to dynamically build a SYMNAMES record with the result by extracting the record count. Then, using the SYMNAMES, generate a control card containing the value you want.

//TOOLIN  DD *                
*                            
 COUNT FROM(NUMBER)          
*                            
 

//TOOLIN  DD *                                          
*                                                        
 COPY FROM(COUNTER) TO(SYMNAMES) USING(CTL1)            
*                                                        
/*                                                      
//CTL1CNTL DD *                                          
*                                                        
  INCLUDE COND=(1,80,SS,EQ,C'RECORD COUNT')              
  OUTREC BUILD=(1:C'MyCount,C',C'''',27,15,C'''',80:X)  
*                                                        
 

//DUMMY   DD *                                                    
DUMMY RECORD                                                      
//TOOLIN  DD *                                                    
 COPY FROM(DUMMY) TO(MYCTRL) USING(CTL1)                          
//CTL1CNTL DD *                                                    
*                                                                  
 OUTFIL FNAMES=MYCTRL,                                            
        BUILD=(1:C' COUNT FROM(INDD) NOTEQUAL(',MyCount,C')',80:X)
*                                                                  
 


Garry.

Re: COUNT and SYSIN

PostPosted: Wed Feb 20, 2019 5:08 pm
by NicC
Seems to be a DFsort question not JCL. Moved.