Working with Time Series Data

Using SAS Data Set Options

You can use the OBS= and FIRSTOBS= data set options to subset the input data set.

For example, the following statements print observations 20 through 25 of the data set FULL:

proc print data=full(firstobs=20 obs=25);
run;

Figure 3: Partial Listing of Data Set FULL

Obsdatestateixyclose
2021OCT1993NC200.448030.353020.44803
2122OCT1993NC210.031861.674140.03186
2223OCT1993NC22-0.25232-1.61289-0.25232
2324OCT1993NC230.425240.731120.42524
2425OCT1993NC240.05494-0.886640.05494
2526OCT1993NC25-0.29096-1.17275-0.29096


You can use KEEP= and DROP= data set options to exclude variables from the input data set. For information about SAS data set options, see SAS DATA Step Statements: Reference.

Last updated: June 19, 2025