IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Numeric check w/SyncSort.


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chillmo

New User


Joined: 31 Aug 2017
Posts: 39
Location: USA

PostPosted: Sun Jan 24, 2021 12:52 am
Reply with quote

I have a requirement to convert a packed file to unpack. I didn't have any issues until the three fields, in the middle of the record, which serves a dual purpose. It's a redefined field that can be PIC S(15) COMP-3 or PIC X(15).

How would I convert this using sort?

Code:
SORT FIELDS=COPY                                     
OUTREC FIELDS=(1:1,2,PD,TO=FS,LENGTH=3,               
               4:3,2,                                 
               6:5,1,                                 
               7:C'+',                               
               8:6,8,PD,M11,LENGTH=15 <-- Field in question
            124:89,8,PD,EDIT=(STTTTTTTTTTTTTTT),SIGNS=(+,-),
            140:97,8,PD,EDIT=(STTTTTTTTTTTTTTT),SIGNS=(+,-),
            156:105,8,PD,EDIT=(STTTTTTTTTTTTTTT),SIGNS=(+,-),
            172:113,8,PD,EDIT=(STTTTTTTTTTTTTTT),SIGNS=(+,-),
            188:121,8,PD,EDIT=(STTTTTTTTTTTTTTT),SIGNS=(+,-),
            204:129,8,PD,EDIT=(STTTTTTTTTTTTTTT),SIGNS=(+,-),
            220:137,8,PD,EDIT=(STTTTTTTTTTTTTTT),SIGNS=(+,-),
            236:145,8,PD,EDIT=(STTTTTTTTTTTTTTT),SIGNS=(+,-))     


The "field in question" fails when it's non-numeric data. I tried to use the following:
Code:
6,8,PD,NE,NUM),OVERLAY=(8:6,15)

OUTREC FIELDS=(1:1,2,PD,TO=FS,LENGTH=3,         
               4:3,2,                           
               6:5,1,                           
               7:C'+',                           
               8:6,8,PD,NE,NUM,OVERLAY=(8:6,15))
                        *                       
WER813I  INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER268A  OUTREC STATEMENT  : SYNTAX ERROR                     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                 

However, I received a syntax error.

So, in short, if the field is numeric, I want to convert the field from PD to ZD (with it's respective sign). If it's non-numeric, I want to move all 15 characters to the output and use space for the the field's sign indicator.

Thanks!
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2143
Location: USA

PostPosted: Sun Jan 24, 2021 2:11 am
Reply with quote

Code:
 IFTHEN=(WHEN=(6,8,PD,NE,NUM),
           OVERLAY=(8:...))
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Syncsort help SYNCSORT 3
No new posts SYNCSORT-DB2 interface SYNCSORT 0
No new posts Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
No new posts Check if CICS is online in JCL CICS 10
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
Search our Forums:

Back to Top