Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Remove leading zeros with spaces using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Thirumurgann

New User


Joined: 13 Feb 2008
Posts: 36
Location: India

PostPosted: Tue Sep 20, 2011 4:40 pm    Post subject: Remove leading zeros with spaces using SORT
Reply with quote

Hi Guys,

Please suggest some ideas on replacing leading zeros with spaces.
I m processing VB file.

My input is like:

Code:

000016080|000024744|MD|FAR                                     |N|10~Home
000142020|000142020|CA|FM                                      |N|10~Home
000153743|000153743|IL|BW                                      |N|4~Auto Se


My output need to be like:

Code:

    16080|    24744|MD|FAR                                     |N|10~Home
   142020|   142020|CA|FM                                      |N|10~Home
   153743|   153743|IL|BW                                      |N|4~Auto Se


Only the leading zeros need to replaced with spaces in first & second fields.

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

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Sep 20, 2011 10:43 pm    Post subject:
Reply with quote

Thiru,

I edited your post with code tags to show what I believe your input and output actually look like. If that's the way they look, then you can do what you want with these DFSORT control statements:

Code:

  OPTION COPY                                 
  INREC OVERLAY=(5:5,9,ZD,TO=FS,LENGTH=9,     
                 15:15,9,ZD,TO=FS,LENGTH=9)   


If that's not the way your input and output look, then show how they do look using code tags.
Back to top
View user's profile Send private message
Thirumurgann

New User


Joined: 13 Feb 2008
Posts: 36
Location: India

PostPosted: Wed Sep 21, 2011 9:31 am    Post subject: Reply to: Remove leading zeros with spaces using SORT
Reply with quote

Hi Frank,

Thank You so much. This is the simple solution that every one could understand. Thanks for offering such simple.

Many of our forum people reply are bit difficult to understand.

Frank,
One clarification again

I used tha above sort card and i got o/p like:

My output :

+16080| +24744|MD|FAR |N|10~Home
+142020| +142020|CA|FM |N|10~Home

But i dont want + symbol before that. Any sugesstions welcome.

Thanks,
Thiru
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Wed Sep 21, 2011 2:12 pm    Post subject: Reply to: Remove leading zeros with spaces using SORT
Reply with quote

Thiru,

If you can work out that it is the TO=FS which is causing your data to look like that, try then searching in the manual for "field formats" and seeing if you can pick one which you think is better, then try it out.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Sep 21, 2011 10:14 pm    Post subject:
Reply with quote

Thiru,

My DFSORT job produces the output you requested. You would NOT get the + signs with DFSORT (ICE messages), so I assume you're using Syncsort (WER messages), not DFSORT.

I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.

Note: If you think you are using DFSORT, show me the complete JES listing for your run.
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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us