Currently I have a massive fiche file that needs to be broken up into different files. Using DFSORT I am able to do this but I also need to include a summary report that includes a count of how many different instances a report grouping shows up. The code below gives me a syntax error on the IFTHEN statement as well as a DEFINE error on the COUNT operator. In essence I am trying to get a COUNT of when a report type and date are in the same entry. This is the first time I've used DFSORT for reporting so I am unsure if an IFTHEN and a COUNT can be used in reporting. If an ICETOOL would be better used here I'm flexible to do so.
//SORTOUT EXEC PGM=SORT
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//KO41SCR DD DSN=&DATAO..KO.DISK.DMS.KO41SCR,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// SPACE=(CYL,(60,15),RLSE),
// DCB=(BLKSIZE=0,RECFM=FB,LRECL=133)
//KO41HLM DD DSN=&DATAO..KO.DISK.DMS.KO41HLM,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// SPACE=(CYL,(60,15),RLSE),
// DCB=(BLKSIZE=0,RECFM=FB,LRECL=133)
//KO41MA DD DSN=&DATAO..KO.DISK.DMS.KO41MA,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// SPACE=(CYL,(60,15),RLSE),
// DCB=(BLKSIZE=0,RECFM=FB,LRECL=133)
//KO41MC DD DSN=&DATAO..KO.DISK.DMS.KO41MC,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// SPACE=(CYL,(60,15),RLSE),
// DCB=(BLKSIZE=0,RECFM=FB,LRECL=133)
//KO41MD DD DSN=&DATAO..KO.DISK.DMS.KO41MD,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// SPACE=(CYL,(60,15),RLSE),
// DCB=(BLKSIZE=0,RECFM=FB,LRECL=133)
//DMSSUM DD DSN=&DATAO..KO.DISK.DMS.SUMMARY.REG,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(80,40),RLSE),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(40,10),RLSE)
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(40,10),RLSE)
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(40,10),RLSE)
//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,(40,10),RLSE)
//SORTWK05 DD UNIT=SYSDA,SPACE=(CYL,(40,10),RLSE)
//SORTIN DD DSN=T.KO.DISK.SIFICH.S41,DISP=SHR
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=KO41SCR, -
INCLUDE=(3,8,CH,EQ,C'KO41SCR '),BUILD=(78,133)
OUTFIL FNAMES=KO41HLM, -
INCLUDE=(3,8,CH,EQ,C'KO41HLM '),BUILD=(78,133)
OUTFIL FNAMES=KO41MA, -
INCLUDE=(3,8,CH,EQ,C'KO41MA '),BUILD=(78,133)
OUTFIL FNAMES=KO41MC, -
INCLUDE=(3,8,CH,EQ,C'KO41MC '),BUILD=(78,133)
OUTFIL FNAMES=KO41MD, -
INCLUDE=(3,8,CH,EQ,C'KO41MD '),BUILD=(78,133)
OUTFIL FNAMES=DMSSUM,LINES=5,REMOVECC,NODETAIL, -
HEADER1=(1:'DMS NOTICE SUMMARY REPORT', -
30:DATE=(MD4/)), -
TRAILER1=(2/, -
3:'KO41HLM = ', -
IFTHEN=(WHEN=(3,8,CH,EQ,C'KO41HLM ',AND,25,4,CH,EQ,C'DATE'), -
COUNT=(EDIT=(IIIIT)))))))
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//KO41SCR DD DSN=&DATAO..KO.DISK.DMS.KO41SCR,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// SPACE=(CYL,(60,15),RLSE),
// DCB=(BLKSIZE=0,RECFM=FB,LRECL=133)
//KO41HLM DD DSN=&DATAO..KO.DISK.DMS.KO41HLM,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// SPACE=(CYL,(60,15),RLSE),
// DCB=(BLKSIZE=0,RECFM=FB,LRECL=133)
//KO41MA DD DSN=&DATAO..KO.DISK.DMS.KO41MA,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// SPACE=(CYL,(60,15),RLSE),
// DCB=(BLKSIZE=0,RECFM=FB,LRECL=133)
//KO41MC DD DSN=&DATAO..KO.DISK.DMS.KO41MC,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// SPACE=(CYL,(60,15),RLSE),
// DCB=(BLKSIZE=0,RECFM=FB,LRECL=133)
//KO41MD DD DSN=&DATAO..KO.DISK.DMS.KO41MD,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// SPACE=(CYL,(60,15),RLSE),
// DCB=(BLKSIZE=0,RECFM=FB,LRECL=133)
//DMSSUM DD DSN=&DATAO..KO.DISK.DMS.SUMMARY.REG,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(80,40),RLSE),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(40,10),RLSE)
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(40,10),RLSE)
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(40,10),RLSE)
//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,(40,10),RLSE)
//SORTWK05 DD UNIT=SYSDA,SPACE=(CYL,(40,10),RLSE)
//SORTIN DD DSN=T.KO.DISK.SIFICH.S41,DISP=SHR
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=KO41SCR, -
INCLUDE=(3,8,CH,EQ,C'KO41SCR '),BUILD=(78,133)
OUTFIL FNAMES=KO41HLM, -
INCLUDE=(3,8,CH,EQ,C'KO41HLM '),BUILD=(78,133)
OUTFIL FNAMES=KO41MA, -
INCLUDE=(3,8,CH,EQ,C'KO41MA '),BUILD=(78,133)
OUTFIL FNAMES=KO41MC, -
INCLUDE=(3,8,CH,EQ,C'KO41MC '),BUILD=(78,133)
OUTFIL FNAMES=KO41MD, -
INCLUDE=(3,8,CH,EQ,C'KO41MD '),BUILD=(78,133)
OUTFIL FNAMES=DMSSUM,LINES=5,REMOVECC,NODETAIL, -
HEADER1=(1:'DMS NOTICE SUMMARY REPORT', -
30:DATE=(MD4/)), -
TRAILER1=(2/, -
3:'KO41HLM = ', -
IFTHEN=(WHEN=(3,8,CH,EQ,C'KO41HLM ',AND,25,4,CH,EQ,C'DATE'), -
COUNT=(EDIT=(IIIIT)))))))
The input file contains the following sample entries:
KO41HLM DATE
KO41HLM ACCT
KO41HLM AMNT
KO41HLM NAME
KO41SCR DATE
KO41SCR ACCT
KO41SCR AMNT
KO41SCR NAME
KO41HLM DATE
KO41HLM ACCT
KO41HLM AMNT
KO41HLM NAME
KO41MA DATE
KO41MA ACCT
KO41MA AMNT
KO41MA NAME
KO41HLM DATE
KO41HLM ACCT
KO41HLM AMNT
KO41HLM NAME
KO41MA DATE
KO41MA ACCT
KO41MA AMNT
KO41MA NAME
KO41HLM DATE
KO41HLM ACCT
KO41HLM AMNT
KO41HLM NAME
KO41HLM ACCT
KO41HLM AMNT
KO41HLM NAME
KO41SCR DATE
KO41SCR ACCT
KO41SCR AMNT
KO41SCR NAME
KO41HLM DATE
KO41HLM ACCT
KO41HLM AMNT
KO41HLM NAME
KO41MA DATE
KO41MA ACCT
KO41MA AMNT
KO41MA NAME
KO41HLM DATE
KO41HLM ACCT
KO41HLM AMNT
KO41HLM NAME
KO41MA DATE
KO41MA ACCT
KO41MA AMNT
KO41MA NAME
KO41HLM DATE
KO41HLM ACCT
KO41HLM AMNT
KO41HLM NAME
The report output should look like this:
DMS NOTICE SUMMARY REPORT 07/26/12
KO41HLM 4
KO41SCR 1
KO41MA 2
KO41MD 0
KO41HLM 4
KO41SCR 1
KO41MA 2
KO41MD 0
Thanks!