Retain non numeric character in IFTHEN - BUILD



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Retain non numeric character in IFTHEN - BUILD

Postby Shambu » Wed Dec 01, 2021 5:00 pm

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))
Shambu
 
Posts: 5
Joined: Tue May 12, 2020 11:56 am
Has thanked: 0 time
Been thanked: 0 time

Re: Retain non numeric character in IFTHEN - BUILD

Postby sergeyken » Sat Dec 04, 2021 2:28 pm

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=())
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post