Page 1 of 1

Compare two records and make an abend

PostPosted: Mon Aug 21, 2017 6:26 pm
by Daouchiche
Hi,

I have two data sets as shown below :

Data Set 01
(Name age location ......)
---------
Ricardo 25 spain



Data Set 02
(Name age location ......)
---------
Ricardo 28 spain


I have to compare the two data sets (records), if 'AGE' is 'Less or Equal' than it's ok. But if 'AGE' of data set 02 Greater than data set 01 then abend.

Thanks for your help.

Coded and corrected terminology

Re: Compare two records and make an abend

PostPosted: Mon Aug 21, 2017 10:40 pm
by Aki88
Hello,

I don't have a ready solution for this, though there is a logical construct:
a. Use JOINKEYS to match both the datasets on their keys
b. Going by your query, you're bothered about only the matched records
c. Use OUTFIL statement to reformat and INCLUDE data that matches your requirement
d. Have another OUTFIL statement in place on exclusion criteria and add NULLOFL check to set an RC
e. Use DFSORT PARM to override RC value with ABE (abend).

Example code can be found at:
http://ibmmainframes.com/about57721.html
http://ibmmainframes.com/about57267.html

I'll try coding a small sample if possible and post it at a later stage; though the aforementioned links provide enough to go on; and one of the posts is by Kolusu, so rest assured IT-WILL-WORK. :)

Re: Compare two records and make an abend

PostPosted: Tue Aug 22, 2017 5:17 pm
by Daouchiche
thanks Aki88, I'll try with those suggestion.