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
 
To insert zeroes in a PIPE delimited file

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

New User


Joined: 10 Mar 2011
Posts: 31
Location: india

PostPosted: Mon Mar 16, 2015 3:05 pm    Post subject: To insert zeroes in a PIPE delimited file
Reply with quote

I have a file in the PIPE delimiter format.

1|2|20150316
1|20|20150316

My output should lokk like

1|002|20150316
1|020|20150316

Second field is three byte field. if its not three bytes i have to insert zeroes infront of each value.

PLease let me know how can we achiev this by using sort command
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Mar 16, 2015 3:36 pm    Post subject: Reply to: To insert zeroes in a PIPE delimited file
Reply with quote

Why do you need to do that? (can't the reader realise that the presence/absence of leading zeros does not affect the value of anything)

Why can't the source of the data make that field fixed-length for you?

If you are stuck doing it, it is a simple PARSE into three parts, and using an EDIT= for the second PARSEd field as you use BUILD to remake the line.
Back to top
View user's profile Send private message
dharmaraok

New User


Joined: 10 Mar 2011
Posts: 31
Location: india

PostPosted: Mon Mar 16, 2015 3:41 pm    Post subject:
Reply with quote

This file is coming from the upstream applications thats why I want to do reformat
how can we parse it by using EDIT option
Back to top
View user's profile Send private message
dharmaraok

New User


Joined: 10 Mar 2011
Posts: 31
Location: india

PostPosted: Mon Mar 16, 2015 4:27 pm    Post subject:
Reply with quote

Thanks Bill,

By using PARSE i have completeed the coding and its working fine.
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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