Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
Hi,
You can use SORT utility. Have a look at the DFSORT & give it a try.
The SUM statement tells DFSORT to summarize records that have equal
control fields. The format of the SUM statement is:
SUM FIELDS=({pos,len{,fmt}{,...} } | NONE}){,FORMAT=fmt}
where - 'pos' = field starting position
'len' = field length, including any sign
'fmt' = field format, FORMAT= may be used if all fields are
the same format. possible values are:
BI = unsigned binary (2, 4 or 8 bytes)
FI = signed fixed-point (2, 4 or 8 bytes)
PD = signed packed decimal (1 to 16 bytes)
ZD = signed zoned decimal (1 to 18 bytes)
'NONE' = deletes duplicate records without summarization
Thank you for your input:
I am aware of the sum fields, but actually here I should have an extra total field which will always be displayed with the all the key records.
what should be sysin: ?
Example:
Input
Deepak English 20
Deepak Maths 20
Output
Deepak English 20 --> 40
Deepak Maths 20 --> 40
here the total is repeating with the complete record , i.e appended at the end.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Sigh. Why didn't you tell me the LRECL was 6000 in the first place?
The length for TRAILER1 fields is limited to 256 bytes, so 1,5982 won't work. You'd have to do it in 256 byte chunks. In this case, SUM would be a better choice like this: