|
View previous topic :: View next topic
|
| Author |
Message |
phani_nittice
New User
Joined: 08 Feb 2006 Posts: 4
|
|
|
|
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 |
|
 |
phani_nittice
New User
Joined: 08 Feb 2006 Posts: 4
|
|
|
|
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 |
|
 |
karthick1990
New User
Joined: 12 Jun 2014 Posts: 4 Location: India
|
|
|
|
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 |
|
 |
phani_nittice
New User
Joined: 08 Feb 2006 Posts: 4
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| 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 |
|
 |
phani_nittice
New User
Joined: 08 Feb 2006 Posts: 4
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| 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 |
|
 |
migusd
New User
Joined: 08 Aug 2014 Posts: 44 Location: USA
|
|
|
|
| where you able to make it work? |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| Please don't reply to old thread instead start a new one next time. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|