View previous topic :: View next topic
|
Author |
Message |
Bruno Oliveira
New User
Joined: 28 Jan 2010 Posts: 16 Location: Portugal
|
|
|
|
Hi there.
I'm trying to find how to get this mask working with the dot but with no luck...
With this SORTIN value in hex:
Code: |
000000
00000C
------
000040
00000C
|
With this job
Code: |
//STEP02 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SORTIN DD *
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=OUT,
IFTHEN=(WHEN=INIT,
BUILD=(1,6,PD,EDIT=(SIIII.TT),SIGNS=(,-))) |
I get:
But I want to get '.00' (without the leading zero but with the dot):
Can you help me, please?
Thanks,
Bruno Oliveira |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
What you say you are getting and what you say you want look the same to me. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Craig,
The "want to get" has a decimal point in each output line.
d |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
What you say you are getting and what you say you want look the same to me. |
Look more closely. The first instance for +0 ( 00) does not have a period whereas the second instance (.00) for +0 does. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Bruno,
You cannot force the period to appear for values without an integer with that edit mask. Assuming you want .dd for +dd and -.dd for -dd, I'd suggest you just post-process the values after editing to get what you want. For example, you could use these DFSORT control statements:
Code: |
SORT FIELDS=COPY
OUTFIL FILES=OUT,
IFTHEN=(WHEN=INIT,
BUILD=(1,6,PD,EDIT=(SIIII.TT),SIGNS=(,-))),
IFTHEN=(WHEN=(6,1,CH,EQ,C' '),
OVERLAY=(6:C'.')),
IFTHEN=(WHEN=(6,1,CH,EQ,C'-'),
OVERLAY=(5:C'-.'))
|
This would give you output values like this:
Code: |
.00
4.00
-4.00
-.00
-.01
.01
|
Why do you NOT want the zero before the period? Normally people do, so they use T.TT which results in 0.dd and -0.dd. |
|
Back to top |
|
|
Bruno Oliveira
New User
Joined: 28 Jan 2010 Posts: 16 Location: Portugal
|
|
|
|
Frank Yaeger,
first of all, thank you for your reply.
I do not want the zero before the period, because I'm replacing a DB2 unload (FORMAT DELIMITED) by DFSORT. DB2 Unload FORMAT DELIMITED uses .00 when a numeric field has a zero value. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Interesting. |
|
Back to top |
|
|
|