Thanks so much Kolusu. That's perfect and just what we need.

I really appreciate your speedy response.


       Regards, 
                Eric Verwijs 

Programmeur-analyste, RPC, SV et solutions de paiement - Direction générale de 
l'innovation, information et technologie
Emploi et Développement social Canada / Gouvernement du Canada
[email protected] 
Téléphone 613-415-5465

Programmer Analyst, CPP, OAS, and Payment Solutions - Innovation, Information 
and Technology Branch
Employment and Social Development Canada / Government of Canada
[email protected] 
Telephone 613-415-5465

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of Sri 
h Kolusu
Sent: November 17, 2022 5:59 PM
To: [email protected]
Subject: Re: ICETOOL / SORT capturing count of output records when using INCLUDE

Eric,

Here is another way to get the output counts into a single dataset.  I also 
used symbols , so that in future if you had to split for a different year, then 
you just need to change the SYMBOLS and the job will automatically take care of 
splitting.

//    EXPORT SYMLIST=*
//    SET YR01=00
//    SET YR02=99
//    SET YR03=98
/*
//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC        98
DEF        98
GHI        98
XXX        00
YYY        00
ZZZ        99
//OUT1     DD SYSOUT=*
//OUT2     DD SYSOUT=*
//OUT3     DD SYSOUT=*
//REPORT   DD SYSOUT=*
//SYSIN    DD *,SYMBOLS=JCLONLY
  OPTION COPY
  INCLUDE COND=(12,02,CH,EQ,C'&YR01',OR,
                12,02,CH,EQ,C'&YR02',OR,
                12,02,CH,EQ,C'&YR03')

  INREC BUILD=(01,20,
               12,2,CHANGE=(3,C'&YR01',C'100',
                              C'&YR02',C'010',
                              C'&YR03',C'001'),
                   NOMATCH=(C'000'))

  OUTFIL FNAMES=OUT1,INCLUDE=(12,02,CH,EQ,C'&YR01'),BUILD=(01,20)
  OUTFIL FNAMES=OUT2,INCLUDE=(12,02,CH,EQ,C'&YR02'),BUILD=(01,20)
  OUTFIL FNAMES=OUT3,INCLUDE=(12,02,CH,EQ,C'&YR03'),BUILD=(01,20)

  OUTFIL FNAMES=REPORT,
  REMOVECC,NODETAIL,BUILD=(80X),
  TRAILER1=('NUM OF RECORDS FOR TYPE &YR01. : ',
             TOT=(21,1,ZD,M10,LENGTH=8),/,
            'NUM OF RECORDS FOR TYPE &YR02. : ',
             TOT=(22,1,ZD,M10,LENGTH=8),/,
            'NUM OF RECORDS FOR TYPE &YR03. : ',
             TOT=(23,1,ZD,M10,LENGTH=8))
/*

Thanks,
Kolusu
DFSORT Development
IBM Corporation



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
[email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to