View previous topic :: View next topic
|
Author |
Message |
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
By those rules, shouldn't D1 be in the output? It isn't. I think file2 is the controlling file, but I don't understand exactly how. The example shown doesn't even indicate which input file the output records come from so it's very confusing. We shouldn't have to guess what the OP wants. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Frank,
I believe D1 is excluded because it has no match.
Quote: |
We shouldn't have to guess what the OP wants. |
For sure . . .
I'm not sure if only the "keys" are to be written or if there even is addtional data in a record. . .
d |
|
Back to top |
|
|
foolsbrain
New User
Joined: 15 Apr 2010 Posts: 11 Location: chennai
|
|
|
|
Hi Dick,
You are right, the output should contain only the records that are in both files. D1 is rejected because it is not present in File2.
Need to write the O/P using File1 records. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Need to write the O/P using File1 records. |
How is the determination made as to which File1 records to keep and which to discard when there is an unequal number in File2? |
|
Back to top |
|
|
foolsbrain
New User
Joined: 15 Apr 2010 Posts: 11 Location: chennai
|
|
|
|
Since we are only matching the key fields of File1 with File2, we can keep any of the matching records.
For example, if A1 is present 5 times in File1 and 3 times in File2, in the output we only need A1 thrice, we can discard any two A1 records. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
fb,
If I understand what you want correctly, you can use a DFSORT/ICETOOL job like the following:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
A1
A1
B1
C1
A1
C1
C1
D1
//IN2 DD *
A1
B1
C1
B1
C1
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
SORT FROM(IN1) TO(T1) USING(CTL1)
SORT FROM(IN2) TO(T2) USING(CTL1)
COPY JKFROM TO(OUT) USING(CTL2)
//CTL1CNTL DD *
SORT FIELDS=(1,2,CH,A)
OUTREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,2))
//CTL2CNTL DD *
JOINKEYS F1=T1,FIELDS=(1,2,A,81,8,A),SORTED,NOSEQCK
JOINKEYS F2=T2,FIELDS=(1,2,A,81,8,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:1,80)
OPTION COPY
/*
|
|
|
Back to top |
|
|
foolsbrain
New User
Joined: 15 Apr 2010 Posts: 11 Location: chennai
|
|
|
|
Hi Frank,
Thanks for the code...
While trying to execute the above jcl, am getting the below error in copy step. Please help on this.
Code: |
COPY JKFROM TO(OUT) USING(CTL2)
SYT050E INVALID OPERAND ON "COPY" STATEMENT
SYT030I OPERATION COMPLETED WITH RETURN CODE 12
SYT015I PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
|
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Methinks that Frank will take no further part in this thread as the product being used in SYNCSORT.
DFSORT and SYNCSORT are competitive products. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The job works fine with DFSORT/ICETOOL. The SYT messages indicate you're using Syncsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
That's why we usually ask to start over a new thread - the OP had DFSORT while foolsbrain posted a related question in between and we all know the end result now! |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Anuj Dhawan wrote: |
That's why we usually ask to start over a new thread - the OP had DFSORT while foolsbrain posted a related question in between and we all know the end result now! |
Will it help if the topic is "cut" into two?. The original topic has grown big for no reason |
|
Back to top |
|
|
|