How to count a number of records in JCL with specified conditions and the result should be display in form of report kind?
Ex; There were 3 differtent types of records like A,B,C in XXX.YYY dataset and i want to count number of A,B,C type records with JCL itself?
Joined: 06 Jun 2008 Posts: 8344 Location: Dubuque, Iowa, USA
and i want to count number of A,B,C type records with JCL itself?
You'll be waiting a long time to do this -- JCL does one thing and only one thing -- execute programs (which include utilities). JCL does nothing else, especially not counting stuff. A program JCL executes may count stuff but the JCL doesn't.
You can do what you want with DFSORT. Exactly how you would do it depends on exactly what your input records look like and exactly what you want for the output report. But if you just need something simple, you can use a DFSORT/ICETOOL job like this:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
//RPT DD SYSOUT=*
//TOOLIN DD *
OCCUR FROM(IN) LIST(RPT) ON(1,1,CH) ON(VALCNT) BLANK
RPT would have:
(1,1,CH) VALUE COUNT
For more information on the OCCUR operator of DFSORT's ICETOOL, see: