Determines whether two hash objects are equal.
| Applies to: | Hash object |
specifies whether the method succeeded or failed.
specifies the name of a hash object.
specifies the name of the second hash object that is compared to the first hash object.
specifies the name of a numeric variable name to hold the result. If the hash objects are equal, the result variable is 1. Otherwise, the result variable is zero.
length eq k 8;
declare hash h1();
h1.defineKey('k');
h1.defineDone();
declare hash h2();
h2.defineKey('k');
h2.defineDone();
rc = h1.equals(hash: 'h2', result: eq);
if eq then
put 'hash objects equal';
else
put 'hash objects not equal';The two hash objects
are defined as equal when all of the following conditions occur:
data x;
length k eq 8;
declare hash h1();
h1.defineKey('k');
h1.defineDone();
declare hash h2();
h2.defineKey('k');
h2.defineDone();
k = 99;
h1.add();
h2.add();
rc = h1.equals(hash: 'h2', result: eq);
put eq=;
k = 100;
h2.replace();
rc = h1.equals(hash: 'h2', result: eq);
put eq=;
run;