chillmo
New User
Joined: 31 Aug 2017 Posts: 39 Location: USA
|
|
|
|
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! |
|