View previous topic :: View next topic
|
Author |
Message |
prabs2006
Active User
Joined: 12 Jan 2006 Posts: 103
|
|
|
|
Hi,
I have a file with records like below
Code: |
123 456 789
1234 7628 23
1 23 4567 |
The O/P should be something like below
Code: |
123 456 789
1234 7628 23
1 23 4567 |
Basically it should be segrgated in an ordered layout.
Thanks & Regards
Prabs |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
How will you know what the longest field length is? |
|
Back to top |
|
|
prabs2006
Active User
Joined: 12 Jan 2006 Posts: 103
|
|
|
|
Hi,
The max length it can take is 9(9).9(2).
Can it be done?
Prabs |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
prabs2006 wrote: |
The max length it can take is 9(9).9(2). |
Which?
Code: |
+..........++..........++..........+
123 456 789
1234 7628 23
1 23 4567 |
or
Code: |
+..........++..........++..........+
123 456 789
1234 7628 23
1 23 4567 |
or
Code: |
+..........++..........++..........+
1.23 4.56 7.89
12.34 76.28 .23
.01 .23 45.67 |
or
Code: |
+..........++..........++..........+
1.23 4.56 7.89
12.34 76.28 .23
.01 .23 45.67 |
|
|
Back to top |
|
|
prabs2006
Active User
Joined: 12 Jan 2006 Posts: 103
|
|
|
|
Hi William,
The last one
Prabs |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
prabs2006 wrote: |
The max length it can take is 9(9).9(2). |
So you want to convert from this:
Code: |
123 456 789
1234 7628 23
1 23 4567 |
to this:
Code: |
+..........++..........++..........+
1.23 4.56 7.89
12.34 76.28 .23
.01 .23 45.67 |
Have you looked at a sort manual, sort has some very interesting functions that might be able to do this.... |
|
Back to top |
|
|
prabs2006
Active User
Joined: 12 Jan 2006 Posts: 103
|
|
|
|
Hi,
The input should be replicated in the output. The inputs should not be tampered.
If the input is 123 the output should also be 123 aligned with other recs.
If the input is 1.23 the output should be 1.23 aligned with other recs.
I would say the second option (and not the last one) in your last reply
I aplogize I didnt make you clear in the last reply only.
Prabs |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Prabs,
Here's a DFSORT job that will do what you asked for. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's PARSE function. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:
Use [URL] BBCode for External Links
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC PARSE=(%01=(ENDBEFR=BLANKS,FIXLEN=11),
%02=(ENDBEFR=BLANKS,FIXLEN=11),
%03=(FIXLEN=11)),
BUILD=(%01,%02,%03)
/*
|
|
|
Back to top |
|
|
prabs2006
Active User
Joined: 12 Jan 2006 Posts: 103
|
|
|
|
Frank,
Thanks a lot.
Prabs |
|
Back to top |
|
|
|