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
 

 

Padding Field with Leading Zeros.

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

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Thu Oct 23, 2008 6:55 pm    Post subject: Padding Field with Leading Zeros.
Reply with quote

Hi,

I need to sort an input file which has somewhat following structure:

Code:

Jack Nicholsan     3
Mathew Perry       1
Tom Hanks          6


I need to get the second field from '3 ' and so on to '03' and so on by padding leading zeros to it.

Is there a way to do it sing SORT.

Regards
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: Thu Oct 23, 2008 9:33 pm    Post subject:
Reply with quote

It's not clear what you want to do exactly. Show the output records you expect for your input records example. Give the RECFM and LRECL of the input file. Give the starting position, length and format for your input and output fields.

Is the second field always just 1 digit? If not, show a better example of your input records with the relevant variations (e.g. 1 digit, 2 digits, etc).
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Mon Oct 27, 2008 2:50 am    Post subject:
Reply with quote

Hi Frank, sorry abt being unclear...

the situation is something like this: whenever i read a '3 ' in a PIC 9(2) variable of cobol it stores it as 30...

so my input file brings me the problematic field '3 ', '1 ' and '6 ' as follows... with pos 1-19 as the name, and 20-21 as number of visits...

lrecl of the input/output file is 21

Code:

Jack Nicholsan     3
Mathew Perry       1
Tom Hanks          6


and i want the output as....

Code:

Jack Nicholsan     03
Mathew Perry       01
Tom Hanks          06
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Oct 27, 2008 3:14 am    Post subject:
Reply with quote

Hi,

try this
Code:
  OPTION COPY                               
  INREC OVERLAY=(20:20,2,UFF,M11,LENGTH=2)   



Gerry
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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 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 IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm


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