Specifies the last row in a data source that SAS processes.
Valid in: | DATA and PROC steps |
Category: | Observation Control |
Default: | MAX |
Restriction: | Use with input files only. |
Supports: | All |
specifies a number
to indicate when to stop processing rows. In this case, n must
be an integer. Using one of the letter notations results in multiplying
the integer by a specific value. That is, specifying K (kilobytes)
multiplies the integer by 1,024, M (megabytes) multiplies by 1,048,576,
G (gigabytes) multiplies by 1,073,741,824, or T (terabytes) multiplies
by 1,099,511,627,776. For example, a value of 20
specifies
20 rows, whereas a value of 3m
specifies
3,145,728 rows.
specifies a number
to indicate when to stop processing as a hexadecimal value. You must
specify the value beginning with a number (0–9), followed by
an X. For example, the hexadecimal value F8 must be specified as 0F8x
in
order to specify the decimal equivalent of 248. The value 2dx
specifies
the decimal equivalent of 45.
sets the number to indicate when to stop processing to 0. Use OBS=0 in order to create an empty data set that has the structure, but not the rows, of another data set.
Interaction | If OBS=0 and the NOREPLACE options are in effect, then SAS can still take certain actions because it actually executes each DATA and PROC step in the program, using no rows. For example, SAS executes procedures, such as CONTENTS and DATASETS, that process libraries or SAS data sets. |
sets the number to indicate when to stop processing to the maximum number of rows in the data set, up to the largest 8-byte, signed integer. That value is 263-1, or approximately 9.2 quintillion. This is the default.
(obs - firstobs) + 1 = results
libname myfiles fedsvr server="d1234.us.company.com" port=2171 user=user1 pwd=pass1 dsn=basedsn; data myfiles.Ages; input Name $ Age; datalines; Miguel 53 Brad 27 Willie 69 Marc 50 Sylvia 40 Arun 25 Gary 40 Becky 51 Alma 39 Tom 62 Kris 66 Paul 60 Randy 43 Barbara 52 Virginia 72 ; proc print data=myfiles.Ages (firstobs=2 obs=12); run;
libname myfiles fedsvr server="d1234.us.company.com" port=2171 user=user1 pwd=pass1 dsn=basedsn; proc print data=myfiles.Ages (firstobs=1 obs=max); where Age LT 60; run;
proc print data=myfiles.Ages (obs=5); where Age LT 60; run;
proc print data=myfiles.Ages (firstobs=2 obs=5); where Age LT 60; run;
proc sql noerrorstop; delete from myfiles.Ages where Name="Sylvia"; quit; proc print data=myfiles.Ages (firstobs=1 obs=max); run;