thomas-rasmussen / sas_macros

SAS macros
Creative Commons Zero v1.0 Universal
5 stars 4 forks source link

hash_match: number of tries are calculated wrong #10

Closed thomas-rasmussen closed 4 years ago

thomas-rasmussen commented 4 years ago

https://github.com/thomas-rasmussen/sas_macros/blob/a7dabf4327000c254ead1c8f01ad89d8c916708e/hash_match.sas#L755-L764

In lines 756 tries is increased regardless of whether or not the observation exists. this is incorrect. Instead move line 756 to between 763 and 764 and change to `if rc = 0 then tries + 1;`

thomas-rasmussen commented 4 years ago

Hmm this change does not make sense since it could easily lead to infinite loops. Instead improve documention on when the n_tries formula works, and add a "min_tries" parameter to make sure we can force the macro to make more tries.

Also rename all the "tries" variables to make things more clear.

thomas-rasmussen commented 4 years ago

Hmm this is not that meaningful either... Drop the whole thing. The underslying problem is the definition of max_tries. This should be slightly changed. This will be descriped in a separate issue.