IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Reformatting the input with leading zeros and comma


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

New User


Joined: 21 Oct 2013
Posts: 5
Location: india

PostPosted: Wed Jan 08, 2014 12:25 pm
Reply with quote

I have an input file with any one of the values:

588
8558
45633
20

The expected output is :

000,588
008,558
045,633
000,020


The output is of 6 numbers with leading zeros and one comma after the first 3 digits. Please let me know how to achieve this using sort/FILEAID
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Jan 08, 2014 12:59 pm
Reply with quote

Code:
//STEP100  EXEC PGM=SORT
//SORTIN   DD  *
588
8558
45633
20
//SORTOUT  DD SYSOUT=*
//SYSIN    DD  *
 SORT FIELDS=COPY
 OUTREC BUILD=(1,6,UFF,EDIT=(TTT,TTT))
/*
//SYSOUT   DD  SYSOUT=*


Output will be

Code:

000,588
008,558
045,633
000,020
Back to top
View user's profile Send private message
venkatprasana

New User


Joined: 21 Oct 2013
Posts: 5
Location: india

PostPosted: Wed Jan 08, 2014 1:13 pm
Reply with quote

Thanks Escapa It worked well. Can u explain what UFF means and its significance
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10697
Location: italy

PostPosted: Wed Jan 08, 2014 1:26 pm
Reply with quote

Escapa provided the working snippet,
why should he waste time retelling what is already explained in the manuals ?

the link is the top at the page

or start from here
Use [URL] BBCode for Links

or search the forums
IIRC one of the DFSORT Developers explained it already
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

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts JOINKEYS to match two input files on ... DFSORT/ICETOOL 3
No new posts Creating a single-record file with CO... DFSORT/ICETOOL 8
No new posts Dynamically read input files using BP... COBOL Programming 20
No new posts To compare an input file with a maste... COBOL Programming 5
No new posts conversational program not reading t... IMS DB/DC 2

Back to Top