I need to split a single file into 2 files, based on a date value at offset 131. Not a big deal.
However, if the date value at offset 131 qualifies the record to be written to the 2nd file,
I also need to qualify all records where cols 5-12 in subsequent records equals cols 5-12 of the qualified date record.
Here's the structure of the file.
SORT FIELDS=(5,17,BI,A)
RECORD TYPE=VB
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
------------------------------------------------------------------------------
********************************* Top of Data **********************************
------------------------------------------------------------------------------
CHER...e......11. .BAS ÀØØØØ.ØØ110502073725110502073837110502073911..
CCCD0008000002FF04440CCE444444444468888088FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
38590035000026110000021200000000004000000011050207372511050207383711050207391100
------------------------------------------------------------------------------
CHER...e..4..ìcc
CCCD000800F005884444444444444444444444444444444444444444444444444444444444444444
38590035014008330000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
------------------------------------------------------------------------------
********************************* Top of Data **********************************
------------------------------------------------------------------------------
CHER...e......11. .BAS ÀØØØØ.ØØ110502073725110502073837110502073911..
CCCD0008000002FF04440CCE444444444468888088FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
38590035000026110000021200000000004000000011050207372511050207383711050207391100
------------------------------------------------------------------------------
CHER...e..4..ìcc
CCCD000800F005884444444444444444444444444444444444444444444444444444444444444444
38590035014008330000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
For example...
if cols 131-136 < '110101' write the record to file2
and all records where cols 5-12 = cols 5-12 of the data qualified record should be written to file2
else write the record to file1.