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: 7306

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: 1534
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: 10231
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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


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