Page 1 of 1

Compare and issue a Return code!!!

PostPosted: Tue May 15, 2012 10:00 pm
by ibmmf4u
Hi Everyone,

My requirement goes this way , Where i will be joining two files and will be sending the data which is matched into one file and other that doesn't match into an another file.I would like to issue a return code of RC4 if the unmatch file contains any data.

Below mentioned were the files:-

File1:-
TEST1      0100
TEST2      0200
TEST3      0300
TEST6      0400


File2:-
TEST1     A123
TEST2     B123
TEST4     C123
TEST5     D123


Match file:-
TEST1     0100    A123
TEST2     0200    B123


UnMatch file:-
TEST3    0300
TEST6    0400


Here i will be joining the two files based on fields present in column1 (TEST) as a key and will be writing the contents that match in both the files into a Match file , and others that doesn't match will be writing the details present in file1 into an UnMatch file , where i would like to issue an RC4 if the UnMatch file contains any data.

Can some one provide me the sort card in achieving the above.

Thanks in advance!!!

Re: Compare and issue a Return code!!!

PostPosted: Wed May 16, 2012 5:25 am
by BillyBoyo
OK, check your documentation for NULLOUT, you can search here, there are some examples of its use.

I think the simplest way to use it will be in a second step, which just copies (one record is enough) the file. You'd have to reverse your condition code checking so that non-zero is OK, zero is not.

It might be more flexible to use an IDCAMS step, as you can set the MAXCC - if LASTCC = 0, set MAXCC to 4, for instance.

Re: Compare and issue a Return code!!!

PostPosted: Wed May 16, 2012 7:40 am
by dick scherrer
Hello,

Why are TEST4 and TEST5 in neither output file?

Re: Compare and issue a Return code!!!

PostPosted: Fri May 18, 2012 11:41 pm
by ibmmf4u
Hi Bill,

Thanks a lot. Will follow your inputs and shall let you know the outcome.

Hi Dick,

I was trying to move the unmatched contents present in file1 hence its present in the output file2.

Re: Compare and issue a Return code!!!

PostPosted: Fri May 18, 2012 11:53 pm
by dick scherrer
Hello,

So, unmatched file2 records are to be completely ignored - right?

Re: Compare and issue a Return code!!!

PostPosted: Sat May 19, 2012 12:04 am
by ibmmf4u
Yes dick it should be ignored!!!