View previous topic :: View next topic |
Author |
Message |
kris_madras Beginner
Joined: 07 Apr 2004 Posts: 41 Topics: 30
|
Posted: Tue Sep 28, 2004 1:19 am Post subject: Converting fields in SYNCSORT |
|
|
Hi,
We're using SYNCSORT in our workshop. There is a small requirement to convert the following fields.
Source : DISP-NRX PIC S9(14)V9999 COMP-3.
Destination : WS-RX-QUANTITY-AMT PIC S9(5)V9(4) COMP-3.
Please suggest me know how can I use the INREC and OUTREC fields for the above conversion..?
Thanks
Kris |
|
Back to top |
|
 |
C D' Rozario Beginner
Joined: 16 Dec 2002 Posts: 5 Topics: 1 Location: San Francisco
|
Posted: Tue Sep 28, 2004 2:42 am Post subject: |
|
|
Hi Kris,
Try this sort card:
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,10,PD,PD,LENGTH=5)
|
This solution is based on the assumption that your packed field is the first field in the input as well as the output file.
Craig |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Sep 28, 2004 5:31 am Post subject: |
|
|
kris,
I don't think you can have more than 8 bytes on outrec for a packed decimal field. so you cannot directly convert 10 bytes to 5 bytes packed.
In the 10 byte packed field, the first 2 bytes will be zeroes unless you have a very huge number. So you can validate from the 3rd byte for 8 bytes and convert it to 5 byte packed decimal field.
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(3,8,PD,PD,LENGTH=5)
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|