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
 

 

Comparing two VB files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: Comparing two VB files
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, http://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    Post subject:
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    Post subject: Reply to: Comparing two VB files
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Tue Jan 26, 2016 9:37 pm    Post subject: Reply to: Comparing two VB files
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Tue Jan 26, 2016 10:36 pm    Post subject: Reply to: Comparing two VB files
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: 11
Location: USA

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

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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Sat Jun 18, 2016 12:10 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm


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