Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

COMPARE FILE-1 & FILE-2 with a specific KEY and write O/

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Mon Dec 12, 2011 9:54 pm    Post subject: COMPARE FILE-1 & FILE-2 with a specific KEY and write O/
Reply with quote

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
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon Dec 12, 2011 10:02 pm    Post subject:
Reply with quote

As a team leader you should have people running around to solve your problems.
Back to top
View user's profile Send private message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Mon Dec 12, 2011 10:05 pm    Post subject: Reply to: COMPARE FILE-1 & FILE-2 with a specific KEY an
Reply with quote

Never mind...nobody works for me. That was just my designation.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Dec 12, 2011 10:08 pm    Post subject:
Reply with quote

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
View user's profile Send private message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Mon Dec 12, 2011 10:11 pm    Post subject: Reply to: COMPARE FILE-1 & FILE-2 with a specific KEY an
Reply with quote

RELEASE : V1R5
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Dec 12, 2011 10:13 pm    Post subject:
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon Dec 12, 2011 10:15 pm    Post subject:
Reply with quote

Team member now? How many times are you going to change your profile?
Back to top
View user's profile Send private message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Mon Dec 12, 2011 10:34 pm    Post subject: Reply to: COMPARE FILE-1 & FILE-2 with a specific KEY an
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Dec 12, 2011 10:34 pm    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Dec 12, 2011 10:35 pm    Post subject:
Reply with quote

Topic moved to JCL forum because the product is SYNCSORT and not DFSORT
Back to top
View user's profile Send private message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Mon Dec 12, 2011 11:07 pm    Post subject: Reply to: COMPARE FILE-1 & FILE-2 with a specific KEY an
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Dec 12, 2011 11:11 pm    Post subject:
Reply with quote

Kolusu is a DFSORT developer, and your product is SYNCSORT, which is a competitior product with DFSORT.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Dec 12, 2011 11:11 pm    Post subject: Reply to: COMPARE FILE-1 & FILE-2 with a specific KEY an
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Mon Dec 12, 2011 11:19 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Dec 12, 2011 11:54 pm    Post subject: Reply to: COMPARE FILE-1 & FILE-2 with a specific KEY an
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us