MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Format and Alignment of Decimal Fields in DFSORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Tue Jun 22, 2004 6:26 am    Post subject: Format and Alignment of Decimal Fields in DFSORT Reply with quote

I'm splitting a file into three parts, based on record type, using DFSORT. I've discovered some of the value fields are formatted quite eccentrically.

Can I convert these fields in DFSORT, or do I need some kind of post-process?

The conversion I need is as follows:
Code:

From        To
19.72     19.72 
   10     10.00 
28.64     28.64 
18.08     18.08 
 20.5      20.50 
  550    550.00 
  6.4      6.40 
20.99     20.99 



The input fields are right-justified, and I need the output fields to be also (the 20.5 line above doesn't seem to want to behave).
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue Jun 22, 2004 6:44 am    Post subject: Reply with quote

Mervyn,

What is the max length of the input field?

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Tue Jun 22, 2004 8:35 am    Post subject: Reply with quote

Kolusu,

Maximum length is 12.
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue Jun 22, 2004 9:49 am    Post subject: Reply with quote

Mervyn,

Try the following DFSORT/ICETOOL job.

Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//TOOLMSG   DD SYSOUT=*                                     
//DFSMSG    DD SYSOUT=*                                     
//IN        DD *                                             
----+----1----+----2----+----3----+----4----+----5----+----6-
       19.72                                                 
          10                                                 
       28.64                                                 
       18.08                                                 
        20.5                                                 
         550                                                 
         6.4                                                 
       20.99                                                 
//D1        DD DSN=&D1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)   
//D2        DD DSN=&D2,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)   
//D3        DD DSN=&D3,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)   
//CON       DD DSN=&D1,DISP=OLD,VOL=REF=*.D1                 
//          DD DSN=&D2,DISP=OLD,VOL=REF=*.D2                 
//          DD DSN=&D3,DISP=OLD,VOL=REF=*.D3                 
//OUT       DD SYSOUT=*                                     
//TOOLIN    DD *                                           
  COPY FROM(IN)  USING(CTL1)                               
  SORT FROM(CON) USING(CTL2)                               
//CTL1CNTL  DD *                                           
  INREC FIELDS=(1,80,SEQNUM,8,ZD)                           
  SORT FIELDS=COPY                                         
  OUTFIL FNAMES=D1,INCLUDE=(1,12,SS,NE,C'.'),               
  OUTREC=(1,12,FS,EDIT=(IIIIIIIIT),C'.00',13,76)           
  OUTFIL FNAMES=D2,INCLUDE=(11,1,CH,EQ,C'.'),               
  OUTREC=(1,10,FS,EDIT=(IIIIIIIIT),C'.',12,1,C'0',13,76)   
  OUTFIL FNAMES=D3,SAVE                                     
//CTL2CNTL  DD *                                           
  SORT FIELDS=(81,8,ZD,A)                                   
  OUTFIL FNAMES=OUT,OUTREC=(1,80)                           
/*   


This will produce
Code:

----+----1----+----2----+----3----+----4----+----5----+----6-
       19.72
       10.00
       28.64
       18.08
       20.50
      550.00
        6.40
       20.99


Hope this helps...

Cheers

kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Tue Jun 22, 2004 10:09 am    Post subject: Reply with quote

Thanks, Kolusu, that's food for thought. There's more than one of these fields in each record, so it's likely to get very messy, but it's a good place to start thinking. I could always use an E35 exit, of course!
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group