Format and Alignment of Decimal Fields in DFSORT
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Utilities

#1: Format and Alignment of Decimal Fields in DFSORT Author: MervynLocation: Hove, England PostPosted: Tue Jun 22, 2004 6:26 am
    —
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).

#2:  Author: kolusuLocation: San Jose PostPosted: Tue Jun 22, 2004 6:44 am
    —
Mervyn,

What is the max length of the input field?

Kolusu

#3:  Author: MervynLocation: Hove, England PostPosted: Tue Jun 22, 2004 8:35 am
    —
Kolusu,

Maximum length is 12.

#4:  Author: kolusuLocation: San Jose PostPosted: Tue Jun 22, 2004 9:49 am
    —
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

#5:  Author: MervynLocation: Hove, England PostPosted: Tue Jun 22, 2004 10:09 am
    —
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!



MVSFORUMS.com -> Utilities


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group