IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Comparing two VB files


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
phani_nittice

New User


Joined: 08 Feb 2006
Posts: 4

PostPosted: Fri Jan 22, 2016 1:19 am
Reply with quote

All,

I've a requirement to compare two VB file (LRECL: 32576), excluding header and trailer records.

If all the records match in both the files excluding header and trailer, then I want to set the RC to 0, else to 4.

Note that header and trailer begin with Q200

I tried the option listed in the following link, ibmmainframes.com/about57721.html, but it is not comparing the records correctly. It is setting RC to 0 even though there are differences.

Please advise[/url]
Back to top
View user's profile Send private message
phani_nittice

New User


Joined: 08 Feb 2006
Posts: 4

PostPosted: Fri Jan 22, 2016 3:33 am
Reply with quote

I tried the following: Even though the VB length is 32576, the maximum length of the record is 4000. So I used JOINKEYS, but the problem is that all the matching records are getting written to SORTOUT and so the return code is never set to 4.

I need to set the return code to 4 only when there is even one record mis-match. If all the records match, then I want the RC to be set to 0.

Please advise.

Code:

  OPTION COPY,NULLOUT=RC4                                               
  JOINKEYS FILE=F1,FIELDS=(5,1000,A)                                   
  JOINKEYS FILE=F2,FIELDS=(5,1000,A)                                   
  JOIN UNPAIRED,F2                                                     
  REFORMAT FIELDS=(F1:5,1000,F2:5,1000)                                 
  OMIT COND=(5,5,CH,EQ,C'Q200')   
Back to top
View user's profile Send private message
karthick1990

New User


Joined: 12 Jun 2014
Posts: 4
Location: India

PostPosted: Sat Jan 23, 2016 4:45 pm
Reply with quote

phani_nittice,
Instead of using JOIN UNPAIRED,F2 (Right outer Join) go with UNPAIRED,F1,F2,ONLY to get only unpaired records from both the input files and SET RC=4 if you get any records in the SORTOUT. Remove the NULLOUT and pass the below parm to set RC4 when you get any unpaired record.

Code:

STEP01 EXEC PGM=SORT,PARM='NOTMTOUT=RC4'




you included OMIT to remove Header, Trailer for File1 only. Add for F2 also.

Karthick Sundarasamy
Back to top
View user's profile Send private message
phani_nittice

New User


Joined: 08 Feb 2006
Posts: 4

PostPosted: Tue Jan 26, 2016 8:03 pm
Reply with quote

Thanks so much Karthick. Could you please suggest how to OMIT header and trailer from both F1 and F2.

I'm using below

Code:
  JOINKEYS FILE=F1,FIELDS=(5,4000,CH,A)                                 
  JOINKEYS FILE=F2,FIELDS=(5,4000,CH,A)                                 
  JOIN UNPAIRED,F1,F2,ONLY                                             
  REFORMAT FIELDS=(F1:5,4000,F2:5,4000)                                 
  SORT FIELDS=COPY                                                     
  OMIT COND=(5,5,CH,EQ,C'M$900')                                       
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jan 26, 2016 9:37 pm
Reply with quote

You can OMIT COND= in JNFnCNTL files, which may not be documented, and there is an OMIT= on the JOINKEYS statement (documented). Same for INCLUDE.
Back to top
View user's profile Send private message
phani_nittice

New User


Joined: 08 Feb 2006
Posts: 4

PostPosted: Tue Jan 26, 2016 10:23 pm
Reply with quote

Bill, are you suggesting this? But this is setting RC = 0 even though there are differences

Code:
//JNF1CNTL DD  *                                                       
  OMIT COND=(5,5,CH,EQ,C'Q$200')                                       
//JNF2CNTL DD  *                                                       
  OMIT COND=(5,5,CH,EQ,C'Q$200')                                       
//OUT      DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                                     
  JOINKEYS FILE=F1,FIELDS=(5,4000,CH,A)                                 
  JOINKEYS FILE=F2,FIELDS=(5,4000,CH,A)                                 
  JOIN UNPAIRED,F1,F2,ONLY                                             
  REFORMAT FIELDS=(F1:5,4000,F2:5,4000) 
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jan 26, 2016 10:36 pm
Reply with quote

That is one of the two things I was suggesting, and it looks like the version you have installed does not support JNFnCNTL datasets. So try the other suggestion.
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Fri Jun 17, 2016 9:29 pm
Reply with quote

where you able to make it work?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Sat Jun 18, 2016 12:10 am
Reply with quote

Please don't reply to old thread instead start a new one next time.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top