I have two input files, File-A and File-B(both are FB, LRECL=80).
File-A contains Header(3 lines identified by 'HDR1','HDR2'&'HDR3'), Detail Records and Trailer(one line identified by 'TLR'). as below.
Code:
HDR1000121data
HDR2000122data
HDR3000123data
RECORD1 A 0001 XXX
RECORD2 B 0002 YYY
RECORD3 C 0003 ZZZ
RECORD4 D 0004 AAA
RECORD5 E 0005 BBB
TLRXXX 00015 COUNT = 00005
File-B contains only the Detail records.
Code:
RECORD6 X 0001 AAA
RECORD7 Y 0002 BBB
RECORD8 Z 0003 CCC
I need to
1. Merge File-A and File-B(format of the o/p file should be similar to File-A, i.e. Header, Detail Records from File-A and File-B, Trailer)
2. Column 8 to 12 of Trailer should contain the SUM of the numeric data present in column 11 to 14 of File-A and File-B.
3. Column 22 to 26 of Trailer should contain the COUNT of detail records of File-A and File-B.
The output file must look like
Code:
HDR1000121data
HDR2000122data
HDR3000123data
RECORD1 A 0001 XXX
RECORD2 B 0002 YYY
RECORD3 C 0003 ZZZ
RECORD4 D 0004 AAA
RECORD5 E 0005 BBB
RECORD6 X 0001 AAA
RECORD7 Y 0002 BBB
RECORD8 Z 0003 CCC
TLRXXX 00021 COUNT = 00008
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
padhumainframe,
With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can now use DFSORT's new IFTRAIL function to update the trailer record. The following DFSORT JCL will give you the desired results.
These PTFs provide important enhancements to DFSORT and DFSORT's ICETOOL for resizing records (RESIZE
operator); updating the trailer record (IFTRAIL); processing subsets (ACCEPT); translation of ASCII to EBCDIC
(TRAN=ATOE), EBCDIC to ASCII (TRAN=ETOA), EBCDIC hex to binary (TRAN=UNHEX), and more; date
field arithmetic (ADDDAYS, ADDMONS, ADDYEARS, SUBDAYS, SUBMONS, SUBYEARS, DATEDIFF,
NEXTDday, PREVDday, LASTDAYW, LASTDAYM, LASTDAYQ and LASTDAYY); timestamp constant with
microseconds (DATE5); group functions (KEYBEGIN); use of SET and PROC symbols in control statements
(JPn"string" in EXEC PARM); more information in reports; larger fields; easier migration from other sort products,
and more.
I was away from mainframes for most of last year... and so from DFSORT too...
I just read through new functions... These are incredible ... especially DATE manipulation related and IFTRAIL...