|
View previous topic :: View next topic
|
| Author |
Message |
Shriram Jogdand
New User

Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
Hi,
I have two files. Both the files have LREC=3,FB. The records in these two files are as below
File-1
AAA
BBB
BBB
CCC
DDD
File-2
111
222
333
444
444
555
I want output (LREC=6,FB) like below
AAA111
AAA222
AAA333
AAA444
AAA444
AAA555
BBB111
.
.
.
DDD444
DDD444
DDD555
As these files dont have common field, so I cant join them with joinkeys.
Please help. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, it is really, really, simple with JOINKEYS, so perhaps a pity you feel you can't use it (either that or I've misunderstood what you want).
Try, in both the JNFnCNTL files, appending a byte to each record, with that byte always having the same value, on both files. Then do the JOINKEYS on the added byte on each file.
Look the output and see if it is what you want. |
|
| Back to top |
|
 |
Shriram Jogdand
New User

Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
I thought that way but I think, that will not work
file-1
AAA.....1
BBB.....2
BBB.....3
CCC....4
DDD....5
File-2
111.....1
222.....2
333.....3
If I will use joinkeys and will join on last byte then I will be able to join 1 with 1, 2 with 2 then 3 with 3, etc... What I want is that first record of file-1 should be appended with all records of file-2, then second record with all recorda of file-2, etc. so the output should be
AAA111
AAA222
AAA333
BBB111
etc...
Correct me, if I misunderstood you  |
|
| Back to top |
|
 |
Pandora-Box
Global Moderator
.jpg)
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
| Quote: |
| Try, in both the JNFnCNTL files, appending a byte to each record, with that byte always having the same value, on both files. |
Shriram you got it wrong
Bill mentioned something like below .So you get a catesian product
file-1
AAA.....1
BBB.....1
BBB.....1
CCC....1
DDD....1
File-2
111.....1
222.....1
333.....1 |
|
| Back to top |
|
 |
Shriram Jogdand
New User

Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
Thanks a lot Bill and Pandora  |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
| Back to top |
|
 |
|
|