IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem with 0.00 in Mask


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bruno Oliveira

New User


Joined: 28 Jan 2010
Posts: 16
Location: Portugal

PostPosted: Mon Jun 20, 2011 11:27 pm
Reply with quote

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:

Code:
      00
    4.00


But I want to get '.00' (without the leading zero but with the dot):

Code:
     .00
    4.00


Can you help me, please?

Thanks,
Bruno Oliveira
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jun 20, 2011 11:35 pm
Reply with quote

What you say you are getting and what you say you want look the same to me.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 20, 2011 11:43 pm
Reply with quote

Hi Craig,

The "want to get" has a decimal point in each output line.

d
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Jun 20, 2011 11:46 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jun 21, 2011 12:11 am
Reply with quote

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
View user's profile Send private message
Bruno Oliveira

New User


Joined: 28 Jan 2010
Posts: 16
Location: Portugal

PostPosted: Tue Jun 21, 2011 6:40 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jun 21, 2011 9:25 pm
Reply with quote

Interesting.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Want to mask Middle 8 Digits of Debit... COBOL Programming 3
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
Search our Forums:

Back to Top