View previous topic :: View next topic
|
Author |
Message |
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
Code: |
OPTION COPY
INREC OVERLAY=(20:20,2,UFF,M11,LENGTH=2)
|
Gerry |
|
Back to top |
|
|
|