|
View previous topic :: View next topic
|
| Author |
Message |
GaganGarg
Active User

Joined: 31 Mar 2010 Posts: 134 Location: India
|
|
|
|
Hi,
I have two file say file1 and file2 whick look like as below:
File1:
| Code: |
XXXXXAAAAAAAABBXXXXXXXXXCCCYYYYYY KKKK
XXXXXAAAAAAAABBXXXXXXXXXDDDYYYYYY KKKK
XXXXXEEEEEEEERRXXXXXXXXXFFFYYYYYY KKKK
|
File2:
| Code: |
AAAAAAAABB STR1
AAAAAAAABB STR2
EEEEEEEERR STR3
|
I want my output in the following format:
| Code: |
XXXXXAAAAAAAABBXXXXXXXXXCCCYYYYYYSTR1KKKK
XXXXXAAAAAAAABBXXXXXXXXXCCCYYYYYYSTR2KKKK
XXXXXAAAAAAAABBXXXXXXXXXDDDYYYYYYSTR1KKKK
XXXXXAAAAAAAABBXXXXXXXXXDDDYYYYYYSTR2KKKK
XXXXXEEEEEEEERRXXXXXXXXXFFFYYYYYYSTR3KKKK
|
I went through IBM doc - Smart DFSORT Tricks and found that this can be a cartesian Join. I tried with that also like below:
| Code: |
//CJ EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input fileA (FB/322)
//IN2 DD DSN=... input fileB (FB/322)
//SORTOUT DD DSN=... output file (FB/322)
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(6,10,A)
JOINKEYS F2=IN2,FIELDS=(6,10,A)
OPTION COPY
/*
|
but when i am submitting the jcl, it is showing "SORTIN not defined", Maxcc=16. I think Joinkeys keyword is not supported in our client mainframe. Please help me out to get the above o/p. I will be very thankful.
Thanks |
|
| Back to top |
|
 |
smijoss
Active User
Joined: 30 Aug 2007 Posts: 114 Location: pune
|
|
|
|
Try this:
| Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=INPUT1,DISP=SHR
//SORTJNF2 DD DSN=INPUT2,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
* Control statements for JOINKEYS application
JOINKEYS FILE=F1,FIELDS=(15,2,A,7,4,A)
JOINKEYS FILE=F2,FIELDS=(21,2,A,23,4,A)
REFORMAT FIELDS=(F2:1,70,F1:1,60)
* Control statements for main task (joined records)
SORT FIELDS=COPY
/* |
another option would be to use splice. |
|
| Back to top |
|
 |
smijoss
Active User
Joined: 30 Aug 2007 Posts: 114 Location: pune
|
|
|
|
btw i just gave syntax ... u need to apply logic.
and regarding whether JOINKEYS is supported or not you need to check the spool. the error message will tell you that |
|
| Back to top |
|
 |
GaganGarg
Active User

Joined: 31 Mar 2010 Posts: 134 Location: India
|
|
|
|
I got the messages as below:
| Code: |
COMMAND INPUT ===> SCROLL ===> CSR
********************************* TOP OF DATA **********************************
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 08:12 ON MON JU
JOINKEYS FILE=F1,FIELDS=(15,2,A,7,4,A)
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
JOINKEYS FILE=F2,FIELDS=(21,2,A,23,4,A)
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
REFORMAT FIELDS=(F2:1,70,F1:1,60)
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
SORT FIELDS=COPY
ICE056A 0 SORTIN NOT DEFINED
ICE751I 0 C5-K90014 C6-K90014 C7-K45047 C8-K42136 E7-K44564
ICE052I 3 END OF DFSORT
******************************** BOTTOM OF DATA ********************************
|
I used the JCL as given below:
| Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=OPERA12.TEST.INPUT.FILE.TEMP1,DISP=SHR
//SORTJNF2 DD DSN=OPERA12.TEST.INPUT.FILE.TEMP2,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(15,2,A,7,4,A)
JOINKEYS FILE=F2,FIELDS=(21,2,A,23,4,A)
REFORMAT FIELDS=(F2:1,70,F1:1,60)
SORT FIELDS=COPY
/*
|
I have given the blank in SYSIN befor Using JOINKEYS. I think JOINKEYS is not supported as i already mentioned  |
|
| Back to top |
|
 |
smijoss
Active User
Joined: 30 Aug 2007 Posts: 114 Location: pune
|
|
|
|
| hey i guess then you can use the splice operator toaccomplish this ... just search for SPLICE in the Sort Mannual |
|
| Back to top |
|
 |
smijoss
Active User
Joined: 30 Aug 2007 Posts: 114 Location: pune
|
|
|
|
since in your case the positions match perfectly i think u could skip the copy.
//EXTRACT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
* Splice records in T1 with matching ON fields
SPLICE FROM(input) WITHALL -
ON(6,10,CH) WITH(33,4) TO(REGNOUT)
/*
//input DD DSN=file1,DISP=SHR
// DD DSN=file2,DISP=SHR
//REGNOUT DD DSN=outfile1,DISP=(NEW,CATLG,DELETE),
// UNIT=3390,SPACE=(CYL,(5,5)) |
|
| Back to top |
|
 |
GaganGarg
Active User

Joined: 31 Mar 2010 Posts: 134 Location: India
|
|
|
|
By using the above JCL:
O/P is
| Code: |
Command ===> Scroll ===> CSR
********************************* Top of Data **********************************
XXXXXAAAAAAAABBXXXXXXXXXCCCYYYYYYSTR2KKKK
XXXXXEEEEEEEEBBXXXXXXXXXFFFYYYYYYSTR3KKKK
******************************** Bottom of Data ********************************
|
It is not the desired o/p  |
|
| Back to top |
|
 |
GaganGarg
Active User

Joined: 31 Mar 2010 Posts: 134 Location: India
|
|
|
|
I tried using the SPLICE operator as followS, but could not get the desired o/p, can anybody please suggest any modification?
| Code: |
//TOOLIN DD *
SPLICE FROM(CON) TO(OUT) ON(6,10,CH) WITHALL WITH(34,4) -
KEEPBASE
/*
|
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
GaganGarg,
JOINKEYS supports Cartesian Join. SPLICE does not.
The messages indicate you do not have the DFSORT PTF required to use JOINKEYS. Ask your System Programmer to install z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009) so you can use JOINKEYS. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|