View previous topic :: View next topic
|
Author |
Message |
subbu1522
New User
Joined: 11 Sep 2008 Posts: 29 Location: USA
|
|
|
|
Hi All, Please help me to solve the below Issue.
I have File-1 (LRECL 300) and FILE-2(LRECL 350). MY O/P file is LRECL 300 same as File-1.
I need to compare the FILE-1 (KEY-1) with FILE-2 (KEY-2) and write the O/P file with all the NON-MATCHED records from FILE-1.
Code: |
KEY-1 = (CLAIM# Pos 6,13,CH & MONEY AMOUNT Pos 28,10,CH & COVG Pos 40,4,CH)
KEY-2 = (CLAIM# Pos 3,13,CH & MONEY AMOUNT Pos 88,10,CH & COVG Pos 277,4,CH) |
Code: |
IF KEY-1 NOT = KEY-2
THEN WRITE RECORD TO THE O/P |
Please help me to acheive this using DFSORT.
Let me know if im not clear with any details. Thank you all in advance. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
As a team leader you should have people running around to solve your problems. |
|
Back to top |
|
|
subbu1522
New User
Joined: 11 Sep 2008 Posts: 29 Location: USA
|
|
|
|
Never mind...nobody works for me. That was just my designation. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Which release level of DFSORT is installed at your site
Pick the output from a sort step and post the ICE201I message line on here |
|
Back to top |
|
|
subbu1522
New User
Joined: 11 Sep 2008 Posts: 29 Location: USA
|
|
|
|
RELEASE : V1R5 |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
expat wrote: |
Which release level of DFSORT is installed at your site
Pick the output from a sort step and post the ICE201I message line on here |
Please supply the information requested, and not what you think you should supply |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Team member now? How many times are you going to change your profile? |
|
Back to top |
|
|
subbu1522
New User
Joined: 11 Sep 2008 Posts: 29 Location: USA
|
|
|
|
I'm sorry I could not find the ICE201I.
But I found the below message
Code: |
WER169I RELEASE 1.3 BATCH 0485 TPF LEVEL 2.2
V=SYNCSORT P=SYNCSORT MESSAGES R=V3R7 I=WER169I |
|
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
subbu1522,
Use the following DFSORT JCL which will give you the desired results.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=Your input FB LRECL 300 File1,DISP=SHR
//SORTJNF2 DD DSN=Your input FB LRECL 350 File2,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS F1=INA,FIELDS=(6,13,A,28,10,A,40,4,A)
JOINKEYS F2=INB,FIELDS=(3,13,A,88,10,A,277,4,A)
JOIN UNPAIRED,F1,ONLY
SORT FIELDS=COPY
//* |
Peter ,
I am not sure your discussion would add anything to solve the problem or mend OP. why bother with trivial issues? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Topic moved to JCL forum because the product is SYNCSORT and not DFSORT |
|
Back to top |
|
|
subbu1522
New User
Joined: 11 Sep 2008 Posts: 29 Location: USA
|
|
|
|
Dear Kolusu, Thank you somuch for the SORT logic. IT is working as expected. But I have encountered a new issue and I need to include the KEY-3
COuld you please HELP ME.
KEY-1 is from FILE-1
KEY-2 & KEY-3 are from FILE-2.
Code: |
KEY-1 = (CLAIM# Pos 6,13,CH & MONEY AMOUNT Pos 28,10,CH & COVG Pos 40,4,CH)
KEY-2 = (CLAIM# Pos 3,13,CH & MONEY AMOUNT Pos 88,10,CH & COVG Pos 277,4,CH)
KEY-3 = (CLAIM# Pos 3,13,CH & MONEY AMOUNT Pos 78,10,CH & COVG Pos 277,4,CH) |
Code: |
IF KEY-1 NOT = KEY-2 AND KEY-3
THEN WRITE RECORD TO THE O/P |
Thank you so much! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Kolusu is a DFSORT developer, and your product is SYNCSORT, which is a competitior product with DFSORT. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
As you have the unmatched only records on your current output, you could do a second step with the second key from file two, again taking the unmatched output. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
subbu1522
Quote: |
COuld you please HELP ME.
|
Yes, now is the time for you to use your brain, a figure this out.
Your SORTOUT file now contains the records from file 1 that did not match the first key of File 2.
What would you need to do with those records to ensure that they did not match the second key of file 2?
Hint: A second pass (sort step) is required. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Just to clear up, I think Dave got there first, my original post was almost identical to expat's of the same time, I then edited it, twice, the second time I think at the same time, or slightly after, Dave's solution. So Dave neither read nor failed to read mine before his. |
|
Back to top |
|
|
|