Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

SYNCSORT :: Check if any Detail records and extract count from Trailer

$
0
0
Author: V S Amarendra Reddy
Subject: Check if any Detail records and extract count from Trailer
Posted: Mon May 08, 2017 8:54 pm (GMT 5.5)

Hi All,

The requirement is below.

Input:(LRECL=80,RECFM=FB)

Code:

01 HEADER
02 DETAIL
02 DETAIL
02 DETAIL
99 0000003


Expected Output:(LRECL=80,RECFM=FB)

Code:

RECORDS RECEIVED
MM/DD/YY COUNT RECEIVED 0000003


In words, the requirement is check if there are any 'D' records in the input. If any, then produce the output like shown above and put the count from the trailer record.

If there are no 'D' records, set return code to 4

Can this be done using syncsort?

I built this card, but it doesn't return 4 when there are no '02'. Also, I know why it doesn't, it is because of the INCLUDE. Here H1,H2 are the symbols I used to put the text

Code:

OPTION COPY,NULLOUT=RC4                           
INCLUDE COND=(1,2,ZD,EQ,02,OR,1,2,ZD,EQ,99)       
OUTFIL IFTHEN=(WHEN=(1,2,ZD,EQ,99),               
        BUILD=(H1,80:X,/,&DATE,X,H2,X,4,7,80:X)),
        OMIT=(1,2,ZD,EQ,02)                       


Please let me know if there are any ideas.


Viewing all articles
Browse latest Browse all 8500

Trending Articles