Copy the part of header to detail records using SORT.
Posted: Sat Feb 11, 2017 10:26 am
Hi everyone,
I need help for the foloing problem. Please have a look at the inpt file and the expected output:
Input file:
Output File:
In the records above, header will have “00” and trailer will always have “99” in start. What I need is to copy the number that is only in header to all records unit we reach the correspondng trailer.
Can you please help me on this.
I need help for the foloing problem. Please have a look at the inpt file and the expected output:
Input file:
Code: Select all
0000000007889HEADER100000
0100000002017DETEST100000
0100000002017DETEST200000
9900000007889TRAILER10000
0000000001540HEADER200000
0100000002017DYTEST100000
0100000002017DYTEST200000
9900000007889TRAILER20000
Code: Select all
0000000007889HEADER100000 078890001
0100000002017DETEST100000 078890002
0100000002017DETEST200000 078890003
9900000007889TRAILER10000 078890004
0000000001540HEADER200000 015400001
0100000002017DYTEST100000 015400002
0100000002017DYTEST200000 015400003
9900000007889TRAILER20000 015400004
Can you please help me on this.