Page 1 of 1

count no. of records based upon condition.

PostPosted: Mon Oct 13, 2008 10:20 pm
by ranga_subham
Hi,

I want to count number of records from a very big file based on condition.

The file has got some records with '?????' at position 727. So, I want to count only those records. How to do it? LRECL of file is 780 and RECFM is FB.

Thanks.

Re: count no. of records based upon condition.

PostPosted: Tue Oct 14, 2008 5:13 am
by dick scherrer
Hello,

Copy the input file to an output file specified as DD DUMMY using INCLUDE to select the records you want.

The count of the copied records will be in the informatoinal output from the run.

Re: count no. of records based upon condition.

PostPosted: Tue Oct 14, 2008 2:54 pm
by ranga_subham
Dick, as per your suggestion I could come up with the below code........ It worked and I got the results as expected......... :D

//STEP0002 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTOUT  DD DUMMY                                         
//SORTIN   DD DSN=USERX.SECND.OUTER.BARXRAY.FISCHERS.BACKS,
//            DISP=(SHR,KEEP,KEEP)                           
//SYSIN    DD *                                             
 SORT FIELDS=COPY                                           
 INCLUDE COND=(727,5,CH,NE,C'?????')                         
/*                                                           
//*                                                         


Thanks.

Re: count no. of records based upon condition.

PostPosted: Wed Oct 15, 2008 2:42 am
by dick scherrer
You're welcome - good to hear it is working.

Thank you for letting us know :)

d