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

Remove leading zeros with spaces using SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Tue Sep 20, 2011 10:43 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Sep 21, 2011 2:12 pm
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 Developer


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

PostPosted: Wed Sep 21, 2011 10:14 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top