View previous topic :: View next topic
|
Author |
Message |
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
I have three i/pfiles of LRECL 20 bytes each.
My O/P file is a 60 byte file.
I need the contents of these I/P files to come horizontally one after the other ( record-1 of file-1 should occupy the first 20 bytes of output file, then record-1 of file-2 should occupy next 20 bytes of o/p file and record-1 of file-3 should occupy next 20 bytes of o/p file)..Like wise it should happen for all the records in the I/P file...
can I use JOINKEYS for this?? I dont(can't) have any field to be checked for joining the files as the I/P files have different values in the corresponding records... |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
AFAIK, you need a KEY to match them, if the key is the order you could use INREC with SEQNUM... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You could generate a sequence number in each record of the 3 files. You could then join by the seqnum.
What should happen if there is not the same number of records in each file?
If this was my requirement, i'd write the tiny bit of cobol code to read the 3 files one itme and write the combined records to the 60-byte file. |
|
Back to top |
|
|
jsathishbabu84
New User
Joined: 07 Jun 2007 Posts: 22 Location: India
|
|
|
|
Hi Raak,
I feel this can be achieved using ICETOOL. Even if you dont have a common field among the files, it can be joined by generating sequence number provided the number of records in all the files should be same.
But i think the possibility is for joining only two files in a single step. You have to join first two files and then joined dataset with the third.
Regards,
SJ |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello SJ,
Please carefully read the posts before replying - this topic is for Syncsort, not DFSORT/ICETOOL.
If one was to generate sequence numbers for all 3 files, then one could use MERGE with no problems.
As i mentioned before, if there are is no "key", a very simple bit of cobol code would give the output Raak requested. No conplexity and only one pass of the data. . . |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
Hi raak,
Please check this link for your requirement.
Thanks,
Shankar |
|
Back to top |
|
|
|