SAS Tip of the Month
There are a few of ways in SAS that limit the number of observations being processed in a datastep or procedure. Two of the more least known are FIRSTOBS= and OBS=, both used as options and are defined as follows:
The following is an example of their usage, selecting observations 10 though to 30 from the dataset SUBANALYSIS for processing in the PRINT procedure:
title1 "Listing of Obs. 10 to 30 of the SUBANALYSIS " "Dataset for Testing Purposes"; proc print data=subanalysis (FIRSTOBS=10 OBS=30); run;
As the example implies these options are best used for Development, Testing or Quality Control purposes so as to reduce time for processing more often than not all data is processed for production reporting purposes.
Updated February 4, 2004