Example 6
OPTION COPY
INREC IFTHEN=(WHEN=(5,2,CH,EQ,C'GP',AND,2,1,BI,EQ,+1),
BUILD=(1,6,16,20,C'T1',X'0003',1,7,20C'1')),
IFTHEN=(WHEN=(5,2,CH,EQ,C'GP',AND,2,1,BI,EQ,+2),
BUILD=(1,6,45,20,C'T2',X'0008',16,7,20C'2')),
IFTHEN=(WHEN=(5,2,CH,EQ,C'GP',AND,2,1,BI,EQ,+3),
BUILD=(1,6,31,20,C'T3',X'0005',25,7,20C'3')),
IFTHEN=(WHEN=NONE,OVERLAY=(27:C'00',X'FFFF')),
IFOUTLEN=57
This example illustrates how you can use IFTHEN clauses with INREC to reformat different records in different ways. IFOUTLEN=57 is used to set the reformatted record length to 57.
Records with 'GP' in positions 5-6 and X'01' in position 2 are
reformatted as follows:
- Position
- Contents
- 1-6
- Input positions 1-6
- 7-26
- Input positions 16-35
- 27-28
- 'T1'
- 29-30
- X'0003'
- 31-37
- Input positions 1-7
- 38-57
- 20 '1's
Records with 'GP' in positions 5-6 and X'02' in position
2 are reformatted as follows:
- Position
- Contents
- 1-6
- Input positions 1-6
- 7-26
- Input positions 45-64
- 27-28
- 'T2'
- 29-30
- X'0008'
- 31-37
- Input positions 16-22
- 38-57
- 20 '2's
Records with 'GP' in positions 5-6 and X'03' in position
2 are reformatted as follows:
- Position
- Contents
- 1-6
- Input positions 1-6
- 7-26
- Input positions 31-50
- 27-28
- 'T3'
- 29-30
- X'0005'
- 31-37
- Input positions 25-31
- 38-57
- 20 '3's
Records without 'GP' in positions 5-6 or without X'01', X'02',
or X'03' in position 2 are reformatted as follows:
- Position
- Contents
- 1-26
- Input positions 1-26
- 27-28
- '00'
- 29-30
- X'FFFF'
- 31-57
- Input positions 31-57