@mkeintz:
Mark, I may be overlooking something, but to my mind the logic is no different in principle from the following (not using FIND/C function deliberately):
data _null_ ;
array rec $1 r1-r8 ("1","2","1","3","4","3","5","2") ;
length hash $ 8 ;
do over rec ;
dup = . ;
do i = 1 to length (hash) ;
if char (hash, i) = rec then dup = 1 ;
end ;
if not dup then hash = cats (hash, rec) ;
end ;
put hash= ;
run ;
Which results in:
hash=12345
The differences are that the real comparison condition is more complex than:
char (hash, i) = rec
and the hash table is used instead of the string HASH. So, basically, we're adding the hash items while eliminating the post-coming dupes in the process, so there's no need to delete anything from the hash when there're no more records.
Kind regards
Paul D.
... View more