Hi, All
I want to groupwise concatenate the record.My input dataset has disposition as RECF=FB and LRECL=80
Input
User Key Level Value <--- Only for reference not in actual dataset
U1 P1 L1 A1
U1 P1 L2 A2
U1 P1 L3 A3
U1 P2 L1 A4
U1 P2 L2 A2
U1 P3 L1 A1
I want the output in below format
Output
U1 P1 L1 A1 L2 A2 L3 A3
U1 P2 L1 A4 L2 A2
U1 P3 L1 A1
U1 is of 2 byte character field.
P1 is a 10 byte character field.
L1 is 2 byte character field.
A1 is a 10 byte character field.
There is no restriction on the output dataset.L1 can have 10 values from 01 to 10. Key is of 10 character long.Value is 8 byte long.
The actual key to be used is User+Key.
Can we do using DFSORT. Please help me.
Please let me know if some more input is required.
Thank You, Sambhaji for your quick reply
The solution that you have provided is done using icetool not with dfsort.
Can we do this using DFSORT not with ICETOOL.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
rgupta71 wrote:
Thanks Kolusu
1 last question
can u plz explain me the significance of 133.
my o/p length 255. What value should I use instead of 133
Thanks
Why would you have a length of 255? You said you have a max of 10 occurrence per key combination and the total length of the fields you want to merge is 12 . so 10X12 = 120 bytes and then you have the key which is 12 bytes. So the total is 120 + 12 = 132 bytes. Why would you want to have 255 bytes as output when the data is only 132 bytes long?
The above code is giving an error
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,
BUILD=(1,12,133:SEQNUM,2,ZD,RESTART=(1,12),13,12)),
IFTHEN=(WHEN=GROUP,BEGIN=(133,2,ZD,EQ,1),RECORDS=10,
*
The * sign is below group
The msg that was in sysout was
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
Can I conclude from the above discussion that I cannot achieve my required output using SYNCSORT.
rgupta71,
AFAIK, there's no extra cost for using a SYNCTOOL solution too. But before that you might want to answer the below question raised by Kolusu.
Skolusu wrote:
Why would you have a length of 255? You said you have a max of 10 occurrence per key combination and the total length of the fields you want to merge is 12 . so 10X12 = 120 bytes and then you have the key which is 12 bytes. So the total is 120 + 12 = 132 bytes. Why would you want to have 255 bytes as output when the data is only 132 bytes long?
The reson for using LRECL=255 was the input file .
The input file that I used to test the job was already having LRECL=133.
So, instead of creating a new dataset to test the job I used already exsisting dataset that met the same criteria.