IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Joining two files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Shriram Jogdand

New User


Joined: 14 Oct 2008
Posts: 65
Location: Pune

PostPosted: Wed Jan 16, 2013 3:33 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jan 16, 2013 3:40 pm
Reply with quote

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
View user's profile Send private message
Shriram Jogdand

New User


Joined: 14 Oct 2008
Posts: 65
Location: Pune

PostPosted: Wed Jan 16, 2013 3:50 pm
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Jan 16, 2013 4:03 pm
Reply with quote

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
View user's profile Send private message
Shriram Jogdand

New User


Joined: 14 Oct 2008
Posts: 65
Location: Pune

PostPosted: Wed Jan 16, 2013 4:05 pm
Reply with quote

Thanks a lot Bill and Pandora icon_biggrin.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Jan 16, 2013 4:10 pm
Reply with quote

look here

ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf

the cartesian join sample seems to fit Your requirement
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top