A well-formed WHERE statement or subsetting IF can narrow down the output of your SAS DATA step. The SAS log does a good job of telling you how many records were processed by the action. For example, let's look at this simple DATA step with my "poor man's random sample", implemented with the RANUNI function:
15 data cars; 16 set sashelp.cars; 17 if ranuni(0) < 0.85; 18 run; NOTE: There were 428 observations read from the data set SASHELP.CARS. NOTE: The data set WORK.CARS has 364 observations and 15 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.00 seconds
The output will also be approximately 85% of the original data, but not exactly. It's random, so the result varies each time that I run it. What if I need to know exactly how many records were processed?
In SAS 9.3, I can now pick that up from the SYSNOBS automatic macro variable. For example:
%put how many = &SYSNOBS;
20 %put how many = &SYSNOBS; how many = 364
This new feature in 9.3 was added as a direct result of a customer suggestion. Keep 'em coming!