|
View previous topic :: View next topic
|
| Author |
Message |
raj.tumu
New User
Joined: 21 Oct 2009 Posts: 7 Location: india
|
|
|
|
Hi,
i want to match 2 files and write into a 3rd file with a extra field
for example
I have a file
file 1
---------
a;ab;abc
b;bb;abc
and another file like
file2
-------
ab 1 20
bb 1 30
I want to match these files
if position 3,4 in file1 is equal to position 1,2 in file2 my output file
should look like this
file3(output)
-------
a;20;ab;abc
b;30;bb;abc
is it possible to do in DFSORT
Thanks! |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
It would help someone help you if you replace the "alphabet-soup" with more meaningful sample data. . .
What are the recfm and lrecl of the files? What positions within the data are relevant? Are the data potitions fixed or might they vary between the delimiters? |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
raj.tumu,
With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), DFSORT now supports the JOINKEYS function which will give you the desired results as shown below
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD *
A;AB;ABC
B;BB;ABC
//SORTJNF2 DD *
AB 1 20
BB 1 30
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(3,2,A)
JOINKEYS FILES=F2,FIELDS=(1,2,A)
REFORMAT FIELDS=(F1:1,2,F2:6,2,F1:2,7)
SORT FIELDS=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 |
|
 |
raj.tumu
New User
Joined: 21 Oct 2009 Posts: 7 Location: india
|
|
|
|
Hi Skolusu,
I have coded this way
//S010 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTJNF1 DD DSN=BH20P.H205VP01.VP201.G0001V00,DISP=SHR
//SORTJNF2 DD DSN=BH20P.PARAM(H2LNDNEW),DISP=SHR
//SORTOUT DD DSN=BWZ0.K026940.RFS4824.TEST,
// DISP=(,CATLG,DELETE),SPACE=(CYL,(150,50),RLSE)
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(18,2,A)
JOINKEYS FILES=F2,FIELDS=(1,2,A)
REFORMAT FIELDS=(F1:1,3,F2:11,10,F1:4,45)
SORT FIELDS=COPY
//*
and i have the following error. do u have any idea..about this
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 23:12 ON WED MAR
JOINKEYS FILES=F1,FIELDS=(18,2,A)
Å
ICE005A 0 STATEMENT DEFINER ERROR
JOINKEYS FILES=F2,FIELDS=(1,2,A)
Å
ICE005A 0 STATEMENT DEFINER ERROR
REFORMAT FIELDS=(F1:1,3,F2:11,10,F1:4,45)
Å
ICE005A 0 STATEMENT DEFINER ERROR
SORT FIELDS=COPY |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
Skolusu mentioned this in his reply
| Quote: |
With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), DFSORT now supports the JOINKEYS function which will give you the desired results as shown below
|
Gerry |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Raj,
You must have z/OS DFSORT V1R5 PTF UK51706 (Nov, 2009) in order to use DFSORT's JOINKEYS function. Ask your System Programmer to install that PTF (it's free). For complete details on the new functions available with that PTF, see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174 |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|