[an error occurred while processing this directive]
There are two ways to run your code on a small subset of observations this. One is to identify the largest dataset in your program and to use the ``obs='' dataset option.
data msf; set crsp.msf(keep=permno date ret obs=2000); date=intnx('month', date, 1)-1; run;
The other is to set the global ``obs='' option. This is done by putting the following statement in open code: i.e., not within a data or proc step.
options obs=2000;What this does is to read a maximum of 2000 observations from any dataset the program encounters. It's quick to put this at the head of your program and run it to check for coding errors. This will find, for instance, variables you have inadvertently left out and referred to later, but other errors may not show up. For example, if observations in a data or proc step that uses by-variables were not properly sorted, you might not know because the particular subset that you run the code with happens to be properly sorted.
To prevent your code from overwriting datasets while you're debugging it, use the ``noreplace'' option, which prevents overwriting of existing datasets:
options obs=2000 noreplace;