I have requirement in which i have to generate header & trailer in a dataset apparently i could generate the header but the trailer is a tricky part for me.
the trailer should have the total record count as well as records where print=y so the desired output is
aaa print=y
aaa xxxxxx
aaa yyyyyy
bbb print=y
bbb abscdc
ccc print=y
ccc hdydhd
ccc ndkksj
ccc hhdhsh
00090003
where 9 is total record count & 3 is records with print=y
[/quote]
This will overlay pos 81 with '1' when the string at pos 5 for 7 bytes equal to PRINT=Y
Code:
OUTFIL BUILD=(1,80),REMOVECC,
BUILD=(1,80) will only write the first 80 bytes to output file as we don't want the additional 1 byte we added for counting the no: of print=y records and removeCC will remove the carriage control character which is printed when using reporting features.
Trailer1 will write the last record with a count of no: of records and the length is limited to 4 bytes and now since you wanted the count of print=y records we use the 1 byte field we added using inrec at pos 81. Since all the records except the print=y record have a zero , when we total it up we will have the count of all print=y records and length is limited to 4 bytes
Wonderfull solution. thats great learning. I remember one scenario for which i couldnt find a solution. I believe you can crack it.
Suppose I have a flat file and i want to start copying the records from a file if certain condition is matched and stop copying when another condition matches.
For example we take a flat file containing list of names. We want to start copyinng the records as soon as we find Kolusu and stop copying the records as soon as we find Sajjan.
I believe you can suggest a feasible solution for this.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I am getting following error:
PARAMETER 'IFTHEN' IS UNIDENTIFIED.
PARAMETER 'BUILD' IS UNIDENTIFIED.
These are JCL Checker errors. Unfortunately, the JCL Checkers do NOT keep up with new functions in DFSORT. Ignore these messages and look at the DFSORT messages (ICExxxs).
Quote:
can you please describe "PUSH=(81:ID=1)" in the above code.
The technique used is described in the S3 example of the "Include or omit groups of records" Smart DFSORT Trick at: