I have PS (FB, 113 LRECL) file which contains 2 fields:
Field1 - starts at 1 & 6 bytes in length
Field2 - Starts at 8 & 9 bytes in length
Here is sample data in the file-
ASS002 009878654
ASS002 998634664
ASS002 485781533
ARR003 346583746
ARR003 361764465
AZZ987 346764766
My Requirement is, I want output PS in following format -
ASS002 3
ARR003 2
AZZ987 1
i.e. count of Field2 records for each Field1 value.
I wrote following code to get output I required -
Code: Select all
//STP030 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=DEVDW.TEMP2.F40002.SB19
//SORTOUT DD DSN=DEVDW.F40002.SB19,
// DSORG=PS,LRECL=113,RECFM=FB,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(4,50),RLSE)
//SYSIN DD *
INREC OVERLAY=(114:SEQNUM,8,ZD,RESTART=(114,6))
SORT FIELDS=(114,6,CH,A,120,9,ZD,A)
OUTFIL REMOVECC,NODETAIL,
BUILD=(1,113),
SECTIONS=(114,6,
TRAILER3=(TOT=(1,6,CH,TO=CH,LENGTH=6),
TOT=(8,9,ZD,TO=ZD,LENGTH=9),
COUNT=(M11,LENGTH=9)))
/*
However, I am getting following messages in SYSOUT -
TRAILER3=(TOT=(1,6,CH,TO=CH,LENGTH=6),
£
ICE223A 0 REPORT FIELD ERROR
TOT=(8,9,ZD,TO=ZD,LENGTH=9),
£
ICE005A 0 STATEMENT DEFINER ERROR
COUNT=(M11,LENGTH=9)))
£
ICE005A 0 STATEMENT DEFINER ERROR
This means, my code statements are not supported on my mainframe.
Is there any other/alternative way to acheive output I require using ICETOOL/SORT??
Thanks,
Suchita