SAS System Options |
Valid in: | configuration file, SAS invocation, OPTIONS statement, SAS System Options window |
Category: | Files: SAS Files |
PROC OPTIONS GROUP= | SASFILES |
Syntax | |
Syntax Description | |
Details | |
Comparisons | |
Examples | |
See Also |
Syntax |
FIRSTOBS= n | nK | nM | nG | nT | hexX | MIN | MAX |
specifies the number of the first observation or external file record to process, with n being an integer. Using one of the letter notations results in multiplying the integer by a specific value. That is, specifying K (kilo) multiplies the integer by 1,024; M (mega) multiplies by 1,048,576 ; G (giga) multiplies by 1,073,741,824; or T (tera) multiplies by 1,099,511,627,776. For example, a value of 8 specifies the eighth observations or records, and a value of 3m specifies observation or record 3,145,728.
specifies the number of the first observation or the external file record to process as a hexadecimal value. You must specify the value beginning with a number (0-9), followed by an X. For example, the value 2dx specifies the 45th observation.
sets the number of the first observation or external file record to process to 1. This is the default.
sets the number of the first observation to process to the maximum number of observations in the data sets or records in the external file, up to the largest eight-byte, signed integer, which is 263-1, or approximately 9.2 quintillion observations.
Details |
The FIRSTOBS= system option is valid for all steps for the duration of your current SAS session or until you change the setting. To affect any single SAS data set, use the FIRSTOBS= data set option.
You can apply FIRSTOBS= processing to WHERE processing. For details, see Processing a Segment of Data That Is Conditionally Selected in SAS Language Reference: Concepts.
Operating Environment Information: The syntax that is shown here applies to the OPTIONS statement. On the command line or in a configuration file, the syntax is specific to your operating environment. For details, see the documentation for your operating environment.
Comparisons |
You can override the FIRSTOBS= system option by using the FIRSTOBS= data set option and by using the FIRSTOBS= option as a part of the INFILE statement.
While the FIRSTOBS= system option specifies a starting point for processing, the OBS= system option specifies an ending point. The two options are often used together to define a range of observations or records to be processed.
Examples |
If you specify FIRSTOBS=50, SAS processes the 50th observation of the data set first.
This option applies to every input data set that is used in a program or a SAS process. In this example, SAS begins reading at the 11th observation in the data sets OLD, A, and B:
options firstobs=11; data a; set old; /* 100 observations */ run; data b; set a; run; data c; set b; run;
Data set OLD has 100 observations, data set A has 90, B has 80, and C has 70. To avoid decreasing the number of observations in successive data sets, use the FIRSTOBS= data set option in the SET statement. You can also reset FIRSTOBS=1 between a DATA step and a PROC step.
See Also |
| |||
| |||
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.