Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Joining two files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Joining two files
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Jan 16, 2013 3:40 pm    Post subject: Reply to: Joining two files
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    Post subject: Joining two files
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

Moderator


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

PostPosted: Wed Jan 16, 2013 4:03 pm    Post subject:
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    Post subject: Joining two files
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10276
Location: italy

PostPosted: Wed Jan 16, 2013 4:10 pm    Post subject: Reply to: Joining two files
Reply with quote

look here

ftp://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us