Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Reformatting the input with leading zeros and comma

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Reformatting the input with leading zeros and comma
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Wed Jan 08, 2014 1:26 pm    Post subject: Reply to: Reformatting the input with leading zeros and comm
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
http://www-03.ibm.com/systems/z/os/zos/bkserv/index.html

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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm
No new posts Getting Mutiple input from Panels vidyaa CLIST & REXX 12 Mon Aug 14, 2017 1:28 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us