View previous topic :: View next topic
|
Author |
Message |
rashmi123
New User
Joined: 04 Jun 2007 Posts: 25 Location: Pune
|
|
|
|
Hi Frank,
I have a flat file, 75 bytes in length.
The file contains 5 fields each 15 bytes in length, the first, third and fourth fields contain numeric values whereas the second and third contain alphabetic values. Each field is left justified with padded spaces in case the value of that field is less than the whole 15 bytes.
Following is a sample record:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
1111111111 aaaaaaaaa bbbbb 22222 12345678
My requirement is right justify the numeric fields with leading zeroes and retain the alphabetic fields as they are.
I want my output formatted in the following way:
000001111111111aaaaaaaaa bbbbb 000000000022222000000012345678
Thanks!
R |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1111111111 aaaaaaaaa bbbbb 22222 12345678
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(1:1,15,UFF,M11,LENGTH=15,
46:46,15,UFF,M11,LENGTH=15,
61:61,15,UFF,M11,LENGTH=15)
/*
|
|
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Rashmi,
Did your shop trade in Syncsort for DFSORT? |
|
Back to top |
|
|
rashmi123
New User
Joined: 04 Jun 2007 Posts: 25 Location: Pune
|
|
|
|
THanks Frank!
And ya no such luck...we still have Syncsort was just wondering how it can be done using DFSort
Thanks! |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
rashmi123 wrote: |
we still have Syncsort was just wondering how it can be done using DFSort |
Does it have OVERLAY? |
|
Back to top |
|
|
rashmi123
New User
Joined: 04 Jun 2007 Posts: 25 Location: Pune
|
|
|
|
Thankfully it does...and it works too!!! |
|
Back to top |
|
|
|