# Numeric check w/SyncSort.

Author Message
chillmo

New User

Joined: 31 Aug 2017
Posts: 21
Location: USA

Posted: Sun Jan 24, 2021 12:52 am

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!
sergeyken
Warnings : 2

Senior Member

Joined: 29 Apr 2008
Posts: 1188

Posted: Sun Jan 24, 2021 2:11 am

 Code: IFTHEN=(WHEN=(6,8,PD,NE,NUM),            OVERLAY=(8:...))
 View Bookmarks All times are GMT + 6 Hours

 Topic Forum Replies Similar Topics Arithmetic division using Syncsort SYNCSORT 6 SUM based on two conditions using SYN... SYNCSORT 7 check if two PD values are equal, no ... DFSORT/ICETOOL 4 Check if it is certain hour, then pro... JCL & VSAM 25 Numeric check on packed signed and un... COBOL Programming 4
Search our Forums: