Proc SurveySelect is not part of Base SAS, so you may not have it available to you.
Within SAS EG under Data is "Random Sample".
If coding here's an idea:
set &inset nobs=N;
retain criteria count fudge 0;
if _n_ = 1 then criteria = N/&size;
if ranuni(-1) + fudge > criteria then do;
if count < 100 then do;
drop criteria count fudge;
By increasing fudge, the probability of selecting a record increases, so that there is a greater change of selecting a particular record.
The downside to this method is that the actual probability distribution is not uniform. If fudge were not used, and "uniformity" maintained, then in a single pass through the dataset, you might not get all "size = 100" records/observations.
An alternative would be to use the POINT= set option
retain count 0;
I = ranuni(-1) * N;
set &inset NOBS=N POINT=I;
if count = &size then stop;
This is probably a better method, and can also be encased in the above macro.
Yes, you are correct for the POINT= method. There would need to be some way to check that that observation hadn't been used already.
Also, the calculation for I isn't quite right either since it doesn't guarantee an integer value.
I = round(ranuni(-1) * N) is an easy solution to the integer problem.
Solving the other problem takes a bit more work.
One way would be to use an array to keep a list of consumed records, and then use a linear search through the array to determine if the observation has been read before or not.
Another way to get a random subset of observations would require multiple passes through the dataset.
selection_key = ranuni(-1);
proc sort data=dummy; by selection_key;
set dummy (obs=&size);
But, this is still not perfectly generic, as none of the ideas are because they introduce at least one variable that may already be defined within the &inset dataset. So, no matter what is done, care must be taken, and some creativity on the part of the programmer.