Requirement : I have a conditional check wherein
1) if value at column 182(2 byte PD Field) is numeric then I have to write the same to output at position 182(2 byte PD Field) else I have to write zeroes.
2) if value in the input at column 184(3 byte PD Field) is numeric and greater then 0 then I have to write input value at 184(3 byte PD Field) else I have write the value at 34 position in the input (3 byte ZD field) to 184 position in the output (PD).
For this requirement I have written following code :
Code:
OPTION COPY
INCLUDE COND=(37,3,CH,EQ,C'AAA',OR,
37,3,CH,EQ,C'ABB',OR,
37,3,CH,EQ,C'CBB',OR,
37,3,CH,EQ,C'CBS')
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
abhishekmdwivedi,
Your IFTHEN=(WHEN=INIT statement is overlaying the contents. You just need to overlay when the conditions are true. Use the following control cards which will give you the desired results.
Code:
//SYSIN DD *
OPTION COPY
INCLUDE COND=(37,3,SS,EQ,C'AAA,ABB,CBB,CBS')
According to the OP's first post, the second requirement was
"if value in the input at column 184(3 byte PD Field) is numeric and greater then 0 then I have to write input value at 184(3 byte PD Field) else I have write the value at 34 position in the input (3 byte ZD field) to 184 position in the output (PD)"
I interpret that as meaning that the overlay from position 34 should only be done if the value is not numeric or if it not greater than zero, in which case the test following the OR in the second IFTHEN should be 'LE,0' (or 'LT,1') not 'LT,0', as in:
Code:
//SYSIN DD *
OPTION COPY
INCLUDE COND=(37,3,SS,EQ,C'AAA,ABB,CBB,CBS')