Page 1 of 1

Retain non numeric character in IFTHEN - BUILD

PostPosted: Wed Dec 01, 2021 5:00 pm
by Shambu
Hello Experts,

I have an input file with two different types of price fields and I want to increase its length from existing 8 bytes to 11 bytes. If the record type is X1 (first 2 char in the input file), then 8 byte price field start from position 3 and position 12. If type is X2, then price record will start from positions 5 and 14. I have created the below sort card for increasing the price field length from 8 bytes to 11 bytes for X1 and X2 records.

However, in some situations, only '*' will be present in place of numeric price fields. So the below code will produce some invalid data if its a * in place of price fields. If its * in price field, I dont want to make the length conversion and any other changes, just want to retain it as * only. Could someone please guide me to obtain this?

OUTREC IFTHEN=(WHEN=(1,2,CH,EQ,C'X1'),
                       BUILD=(3:3,9,ZD,TO=ZD,LENGTH=11,
                                  14:12,9,ZD,TO=ZD,LENGTH=11)),
       IFTHEN=(WHEN=(1,2,CH,EQ,C'X2'),
                      BUILD=(1,4,5:5,9,ZD,TO=ZD,LENGTH=11,
                                       16:14,9,ZD,TO=ZD,LENGTH=11))

Re: Retain non numeric character in IFTHEN - BUILD

PostPosted: Sat Dec 04, 2021 2:28 pm
by sergeyken
Add one more case as the first one:
… IFTHEN=(WHEN=(1,1,CH,EQ,C’*’),BUILD=(…)),

Or add the last one:
   IFTHEN=(WHEN=NONE,BUILD=())