Below is sample code on how to lookup using the new technique.
proc fcmp outlib=work.funcs.test;
subroutine s(a, b $, c $);
outargs a, b;
declare dictionary d;
if c = 'add' then do;
d[a] = b;
d[b] = a;
end;
else if c = 'get_a' then do;
a = d[b];
end;
else if c = 'get_b' then do;
b = d[a];
end;
endsub;
run;
options cmplib=work.funcs;
data _null_;
a = 1; b='xxx';
call s(a, b, 'add');
call missing(a);
put "Note: get_a before " a= b=;
call s(a, b, 'get_a');
put "Note: get_a after " a= b=;
call missing(b);
put "Note: get_b before " a= b=;
call s(a, b, 'get_b');
put "Note: get_b after " a= b=;
run;
Output:
Note: get_a before a=. b=xxx
Note: get_a after a=1 b=xxx
Note: get_b before a=1 b=
Note: get_b after a=1 b=xxx