Our input extract was as follows:
----+--
22 1000
33 2400
40 4832
40 5458
55 5458
22 5458
33 5458
29 5458
00 5458
00 5458
----+--
22 1000
33 2400
40 4832
40 5458
55 5458
22 5458
33 5458
29 5458
00 5458
00 5458
As per the record status we needed to count number of occurances of hte record statuses in the report and list down as mentioned below.
And the expected output was as follows:
COUNT OF RECORD STATUS 00 (HEADER11) : 2
COUNT OF RECORD STATUS 22 (HEADER22) : 2
COUNT OF RECORD STATUS 29 (OTHER) : 1
COUNT OF RECORD STATUS 33 (HEADER44) : 2
COUNT OF RECORD STATUS 40 (HEADER55) : 2
COUNT OF RECORD STATUS 55 (HEADER66) : 1
COUNT OF RECORD STATUS 00 (HEADER11) : 2
COUNT OF RECORD STATUS 22 (HEADER22) : 2
COUNT OF RECORD STATUS 29 (OTHER) : 1
COUNT OF RECORD STATUS 33 (HEADER44) : 2
COUNT OF RECORD STATUS 40 (HEADER55) : 2
COUNT OF RECORD STATUS 55 (HEADER66) : 1
For this we developed following control/sort card
INREC FIELDS=(1,2,X,1,2,CHANGE=(17,C'00',C'(HEADER11)',
C'22',C'(HEADER22)',
C'33',C'(HEADER44)',
C'40',C'(HEADER55)',
C'55',C'(HEADER66)'),
NOMATCH=(C'(OTHER)'),60X)
SORT FIELDS=(1,2,ZD,A)
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(1,2,TRAILER3=('COUNT OF RECORD STATUS ',1,20,': ',COUNT))
C'22',C'(HEADER22)',
C'33',C'(HEADER44)',
C'40',C'(HEADER55)',
C'55',C'(HEADER66)'),
NOMATCH=(C'(OTHER)'),60X)
SORT FIELDS=(1,2,ZD,A)
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(1,2,TRAILER3=('COUNT OF RECORD STATUS ',1,20,': ',COUNT))
~ SECTIONS groups the data on the basis of the RECORD status
~ TRAILER3 displays the specified sting at the end of each section.
~ REMOVECC removes the ANSI printer control characters
~ NODETAIL suppresses the copying of the input data to the output.
~ TRAILER3 displays the specified sting at the end of each section.
~ REMOVECC removes the ANSI printer control characters
~ NODETAIL suppresses the copying of the input data to the output.
This topic is for sharing, if you have any other solution for this then please feel free to post