View previous topic :: View next topic
|
Author |
Message |
Thirumurgann
New User
Joined: 13 Feb 2008 Posts: 36 Location: India
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Thirumurgann
New User
Joined: 13 Feb 2008 Posts: 36 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|