Hi,
My requirement is to split a file into three files based on the totals. Please find the example below
INPUT FILE:
RECORD 1
RECORD 1
RECORD 1
.
.
RECORD 1
TOTAL-1 XXX
RECORD 2
RECORD 2
.
.
RECORD 2
TOTAL-2 XXX
RECORD 3
RECORD 3
.
.
RECORD 3
TOTAL-3 XXX
RECORD 4
RECORD 4
.
.
RECORD 4
TOTAL-4 XXX
OUTPUT FILEs:
FILE1:
RECORD 1
RECORD 1
RECORD 1
.
.
RECORD 1
TOTAL-1 XXX
FILE2:
RECORD 2
RECORD 2
RECORD 2
.
.
RECORD 2
TOTAL-2 XXX
RECORD 3
RECORD 3
.
.
RECORD 3
TOTAL-3 XXX
FILE3:
RECORD 4
RECORD 4
.
.
RECORD 4
TOTAL-4 XXX
Input and output files should have same record length of 133 and same format as FB. I am familier with splitting the files using number of records, But the record count is not constant in this case.
Please help me in solving the above problem.
Thanks in Advance,
Amar