what does the line "if 0 then set want_lookup" mean
It should have been "if 0 then set have_rathersmall_lookup(keep=id date);" That's a mapping step to define variables used by the hash. I've added some comments to the already posted code which hopefully will increase clarity.
"What I'd prefer is a dataset that include one indicator of the earlist date it is found."
Best would be if you could post some sample data and then explain the desired result. What would you expect for example if you have records for an ID where the earliest data doesn't match your look-up table? And what would you expect to get for ID's which never have a date in the range?
Whatever you need can be done - but it will be quite a bit of coding. To pre-sort your large table would make things much easier. How big is your table really? Is it worth all the extra coding logic.?
... View more