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

Like to do a Cartesian join between two file


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

New User


Joined: 02 Aug 2006
Posts: 1

PostPosted: Wed Aug 02, 2006 7:40 pm
Reply with quote

hi,
i would like to do a Cartesian join between two file for example i have two
files A and B my key is the first three characters :
A
111 123456
111 987565
111 365845
222 333333

B
111 a
111 b
222 c

output :
111 123456 a
111 987565 a
111 365845 a
111 123456 b
111 987565 b
111 365845 b
222 333333 c
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Wed Aug 02, 2006 9:10 pm
Reply with quote

Hi,
If you are having SYNCSORT latest version,use the JOIN FEATURE to get the desired results.
If you are having DFSORT ,Use the SPLICE operator.

Lot many examples are available in the forum.Please check.

Thank you
Krishy
Back to top
View user's profile Send private message
natan66

New User


Joined: 16 Sep 2005
Posts: 5

PostPosted: Wed Aug 02, 2006 11:42 pm
Reply with quote

i didn't figure the way to do a many to many join with splice.
can anyone give me an example.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Aug 03, 2006 12:28 am
Reply with quote

Did you do a search for "cartesian" before posting?

Please read this previous post.
Back to top
View user's profile Send private message
natan66

New User


Joined: 16 Sep 2005
Posts: 5

PostPosted: Thu Aug 03, 2006 11:26 pm
Reply with quote

hi,
I looked for the word join.

thanks for the help anyway.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 25, 2009 4:20 am
Reply with quote

With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), you can now do a Cartesian join with JOINKEYS. For your example, you could use a DFSORT job like this:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//A DD *
111 123456
111 987565
111 365845
222 333333
//B DD *
111 a
111 b
222 c
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  JOINKEYS F1=B,FIELDS=(1,3,A),SORTED
  JOINKEYS F2=A,FIELDS=(1,3,A),SORTED
  REFORMAT FIELDS=(F2:1,11,F1:5,1)
  OPTION COPY
/*


For complete details on JOINKEYS and the other new functions available with the Nov, 2009 DFSORT PTF, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174
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 How to split large record length file... DFSORT/ICETOOL 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top