Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Compare 2 files, only write output conditionally

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

New User


Joined: 08 Jan 2013
Posts: 20
Location: usa

PostPosted: Tue Jan 14, 2014 3:47 am    Post subject: Compare 2 files, only write output conditionally
Reply with quote

Hi

So I have 2 files which can be matched on 1,8,ch

I want to check the value in column 26,5,bi in both files, only if they are different I want to write out an output record with the key and the both values (from the first file and the second file)

Using syncsort, input files are both FB, 132.

Let me know if you need any more info

Thanks
Norm
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Jan 14, 2014 6:06 am    Post subject: Reply to: Compare 2 files, only write output conditionally
Reply with quote

JOIINKEYS with 1,8 on both files.
No JOIN statement (so you only get the matches)
REFORMAT with key from one file (doesn'tmatter which) and data you need from F1 and F2.
OMIT COND=(for fields equal) in the Main Task.
Back to top
View user's profile Send private message
norm.flynn

New User


Joined: 08 Jan 2013
Posts: 20
Location: usa

PostPosted: Tue Jan 14, 2014 11:13 pm    Post subject: Re: Reply to: Compare 2 files, only write output conditional
Reply with quote

tried the following but the job seemed to loop so I cancelled it, do you see anything wrong with the following sysin, wasn't sure about how to code the omit card

Code:
JOINKEYS FILE=F1,FIELDS=(92,8,A)               
 JOINKEYS FILE=F2,FIELDS=(92,8,A)               
 REFORMAT FIELDS=(F1:92,8,F1:169,5,F2:169,5)   
 OUTFIL OMIT=(9,5,BI,EQ,14,5,BI)               
 SORT FIELDS=COPY                 
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Jan 14, 2014 11:56 pm    Post subject: Reply to: Compare 2 files, only write output conditionally
Reply with quote

Because the Main Task is processed after the two JOINKEYS sub-tasks, you can just use OMIT COND=(, but with no other processing you shouldn't see much difference to what you have.

Are the files in sequence? Each of your inputs is being sorted. If they are in sequence, add ",SORTED" to the end of appropriate JOINKEYS statement.

Looping is difficult in SORT, as there are no looping-constructs. I'd guess you're not expecting the data to be sorted again.

The other thing which can chew up time is duplicate keys.

Run first with very small sample inputs, and check the start-position of the keys if you still have problems.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jan 15, 2014 12:26 am    Post subject:
Reply with quote

Hello,

Quote:
tried the following but the job seemed to loop

How did the job seem to loop?

Did you look to see fi the job was issuing I/Os or if there was only CPU being used?

Hopefully, you are Not trying to do your initial testing with full files . . .
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 Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 1 Fri Nov 17, 2017 9:49 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us