Another option:
proc sql noprint;
select rule into :var1- from mydatasetname;
quit;
%let nvars=&sqlobs;
You don't even have to know how many &var variables will be created, SAS figures it out for you. The number created is in &SQLOBS, which I have stored for later use in &NVARS.
Note: if the numbers in s_no are not consecutive, this may or may not work, depending on what you do with them. The CALL SYMPUTX method that I provided earlier will work if s_no are not consecutive.
... View more