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

Pad trailing zeroes with dfsort


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

New User


Joined: 08 Apr 2009
Posts: 2
Location: Mumbai

PostPosted: Wed May 19, 2010 1:00 pm
Reply with quote

Hi,

I have an input file(LRECL=10) that can contain records upto 9 digits

Sample input file:

----+----1
1000
87657
36815543


I require the output file to be padded with trailing zeroes.

Required output file:

----+----1----+----2
1000000000000000
8765700000000000
3681554300000000

Can anyone guide me?

Thanks,
Utpal
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed May 19, 2010 9:09 pm
Reply with quote

utpalshan,

Assuming that you have trailing spaces , the following DFSORT jcl will give you the desired results. The output file length is set to 20 bytes.

Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD DSN=your 10 byte input file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                     
  INREC IFTHEN=(WHEN=INIT,FINDREP=(INOUT=(C' ',C'0'))),
  IFTHEN=(WHEN=INIT,BUILD=(1,10,10C'0'))               
//*
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts Remove leading zeroes SYNCSORT 4
Search our Forums:

Back to Top