View previous topic :: View next topic |
Author |
Message |
MVS_blob Beginner
Joined: 23 Oct 2007 Posts: 23 Topics: 9
|
Posted: Tue Aug 05, 2008 3:01 am Post subject: DFSORT - writing packed decimal with sign of F |
|
|
Hi,
I've got this bit of code which will convert a number to packed decimal with a sign of 'C'.
Code:
Code: |
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT,
OUTREC=(1,4,ZD,TO=PD,LENGTH=3)
|
Input:
Output (HEX):
I need to convert it to packed decimal with sign of 'F' instead (HEX):
I've had a read of the DFSORT Application Programming guide at the EDIT= statement, but the parameters I,T,S don't appear to cater for packed decimal.
Any ideas? |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Aug 05, 2008 4:47 am Post subject: |
|
|
why do you have to create a 'non-valid' sign? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Tue Aug 05, 2008 4:51 am Post subject: |
|
|
MVS_blob,
Why you wanna have 'F'. Both F and C stands for positive. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Aug 05, 2008 10:36 am Post subject: |
|
|
MVS_blob,
You can use PDF format to force DFSORT to put a F instead of C
Code: |
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT,
OUTREC=(1,4,ZD,TO=PDF,LENGTH=3)
|
Hope this helps....
Cheers _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Tue Aug 05, 2008 10:49 am Post subject: |
|
|
vkphani wrote: |
Why you wanna have 'F'. |
One advantage is that the 'F' sign generates printable numerics if you unpack it later! _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
MVS_blob Beginner
Joined: 23 Oct 2007 Posts: 23 Topics: 9
|
Posted: Tue Aug 05, 2008 6:24 pm Post subject: |
|
|
Thanks kolusu,
TO=PDF works great.
The reason I need to have the packed sign as 'F' is because the output file will be compared with an existing production file. The production file is read by an EZYTRIEVE program that has the field defined as 'P' which sets the sign to 'F' by default.
Regards,
Blob. |
|
Back to top |
|
 |
|
|