I have groups of records that I need to add a value to each record in a group then +1 to the next set of records.
The records are all different lengths with differnet data but I have included the fields at the beginning which are in the same positions.
Here is an example of my records:
here is where I need to sequence the records the same number for all records in this group
------------------------------vvvvvv------
000012151782010-06-265000001 10
000012151782010-06-075000001 20
000012151782010-06-265000001 30
000012151782010-06-265000002 30
000012151782010-06-075000001 40
000012151782010-06-075000001 50
000012151782010-06-075000002 20
000012151782010-06-265000003 30
000012151782010-06-265000004 30
000012151782010-06-075000002 40
000012151782010-06-075000002 50
000012194532010-06-265000002 10
000012194532010-06-075000003 20
000012194532010-06-265000005 30
000012194532010-06-265000006 30
000012194532010-06-075000003 40
000012194532010-06-075000003 50
000012151782010-06-265000001 10
000012151782010-06-075000001 20
000012151782010-06-265000001 30
000012151782010-06-265000002 30
000012151782010-06-075000001 40
000012151782010-06-075000001 50
000012151782010-06-075000002 20
000012151782010-06-265000003 30
000012151782010-06-265000004 30
000012151782010-06-075000002 40
000012151782010-06-075000002 50
000012194532010-06-265000002 10
000012194532010-06-075000003 20
000012194532010-06-265000005 30
000012194532010-06-265000006 30
000012194532010-06-075000003 40
000012194532010-06-075000003 50
Here is the code I used until I found out not all groups will have a '10' record. I knew there was going to be a problem having two '30' records in a group. I am also changing the dates on certain records. The positions are correct they may not match the included records above since I did not include the entire record(s).
OPTION COPY
INREC IFTHEN=(WHEN=(54,2,CH,EQ,C'10'),
OVERLAY=(239:C'2010-06-26',
20:C'2010-06-26',71:C'2010-06-26',
31:SEQNUM,6,ZD,START=1)),
IFTHEN=(WHEN=(54,2,CH,EQ,C'20'),
OVERLAY=(31:SEQNUM,6,ZD)),
IFTHEN=(WHEN=(54,2,CH,EQ,C'30'),
OVERLAY=(125:C'2010-06-26',
20:C'2010-06-26',71:C'2010-06-26',
31:SEQNUM,6,ZD)),
IFTHEN=(WHEN=(54,2,CH,EQ,C'40'),
OVERLAY=(31:SEQNUM,6,ZD)),
IFTHEN=(WHEN=(54,2,CH,EQ,C'50'),
OVERLAY=(31:SEQNUM,6,ZD)),
IFTHEN=(WHEN=(54,2,CH,NE,C'99'),
OVERLAY=(20:C'2010-06-26',71:C'2010-06-26'))
INREC IFTHEN=(WHEN=(54,2,CH,EQ,C'10'),
OVERLAY=(239:C'2010-06-26',
20:C'2010-06-26',71:C'2010-06-26',
31:SEQNUM,6,ZD,START=1)),
IFTHEN=(WHEN=(54,2,CH,EQ,C'20'),
OVERLAY=(31:SEQNUM,6,ZD)),
IFTHEN=(WHEN=(54,2,CH,EQ,C'30'),
OVERLAY=(125:C'2010-06-26',
20:C'2010-06-26',71:C'2010-06-26',
31:SEQNUM,6,ZD)),
IFTHEN=(WHEN=(54,2,CH,EQ,C'40'),
OVERLAY=(31:SEQNUM,6,ZD)),
IFTHEN=(WHEN=(54,2,CH,EQ,C'50'),
OVERLAY=(31:SEQNUM,6,ZD)),
IFTHEN=(WHEN=(54,2,CH,NE,C'99'),
OVERLAY=(20:C'2010-06-26',71:C'2010-06-26'))
I would appreciate any help.
Thanks You.