View previous topic :: View next topic
|
Author |
Message |
natan123
New User
Joined: 02 Aug 2006 Posts: 1
|
|
|
|
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 |
|
|
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
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 |
|
|
natan66
New User
Joined: 16 Sep 2005 Posts: 5
|
|
|
|
i didn't figure the way to do a many to many join with splice.
can anyone give me an example. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
natan66
New User
Joined: 16 Sep 2005 Posts: 5
|
|
|
|
hi,
I looked for the word join.
thanks for the help anyway. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|