a) Entry present in CR file only => copy as it is into OUT file
b) Entry present in DR file only => change the sign of amount field and write into the OUT file
c) Entry present in both files => subtract amount fields i.e CR - DR and write into OUT file
The amount values displayed are actually in PACKED Decimal format. S9(11)V99 comp-3.
Trailer record contains the count (including header and trailer)
Code:
File-CR Layout
HDR XXXX
DET A222 100.00
DET A333 600.00
DET A555 300.00
DET A666 400.00
TRL 0006
Code:
File-DR Layout
HDR XXXX
DET A111 200.00
DET A222 400.00
DET A444 700.00
DET A555 900.00
DET A999 300.00
TRL 0007
Code:
Desired Output Layout :
HDR XXXX
DET A111 -200.00
DET A222 -300.00
DET A333 600.00
DET A444 -700.00
DET A555 -600.00
DET A666 400.00
DET A999 -300.00
TRL 0009
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
All fixed...
Raveendra,
If you have looked at other posts on this forum, you may have noticed that most posts have included additional information like lrecl, recfm and such. Take a look and add the info, your help will be available sooner.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Ravenendra,
You don't need SPLICE for this.
Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed that your input files have RECFM=FB and LRECL=80, that the first field is in positions 1-3, the second field in positions 9-12 and the third field (7-byte PD) in positions 15-21.