View previous topic :: View next topic
|
Author |
Message |
rashmi123
New User
Joined: 04 Jun 2007 Posts: 25 Location: Pune
|
|
|
|
Hi all,
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:
Code: |
----+----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:
Code: |
000001111111111aaaaaaaaa bbbbb 000000000022222000000012345678 |
I am running on SYNCSORT FOR Z/OS 1.3.0.2R.
Thanks!
Rashmi
Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
rashmi123 wrote: |
the first, third?? and fourth fields contain numeric values whereas the second and third contain alphabetic values. |
From the sample data you posted, I assumed the numeric fields as 1st,4th, and 5th fields. You can use the below SyncSort job to achieve this. Good luck
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
1111111111 aaaaaaaaa bbbbb 22222 12345678
444 aaaaaaaaa bbbbb 664 12
5 aaaaaaaaa bbbbb 9 6666
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(01:01,15,UFF,ZD,LENGTH=15,
46:46,15,UFF,ZD,LENGTH=15,
61:61,15,UFF,ZD,LENGTH=15) |
SORTOUT
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
000001111111111aaaaaaaaa bbbbb 000000000022222000000012345678
000000000000444aaaaaaaaa bbbbb 000000000000664000000000000012
000000000000005aaaaaaaaa bbbbb 000000000000009000000000006666 |
|
|
Back to top |
|
|
rashmi123
New User
Joined: 04 Jun 2007 Posts: 25 Location: Pune
|
|
|
|
Thanks...it worked! |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Congratulations Arun - You are getting Intuitive..! |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Thanks Anuj |
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
hi Arun,
Can you please expalin about UFF data format? why did you not use CH?
Thanks,
Ajay |
|
Back to top |
|
|
|