Opens a SAS data set.
Category: | SAS File I/O |
is a character constant, variable, or expression that specifies the name of the SAS data set or SAS SQL view to be opened. The value of this character string should be of the form
Default | The default value for data-set-name is _LAST_. |
Restriction | If you specify the FIRSTOBS= and OBS= data set options, they are ignored. All other data set options are valid. |
is a character constant, variable, or expression that specifies the type of access to the data set:
I | opens the data set in INPUT mode (default). Values
can be read but not modified. 'I' uses
the strongest access mode available in the engine. That is, if the
engine supports random access, OPEN defaults to random access. Otherwise,
the file is opened in 'IN' mode automatically.
Files are opened with sequential access and a system level warning
is set.
|
IN | opens the data set in INPUT mode. Observations are read sequentially, and you are allowed to revisit an observation. |
IS | opens the data set in INPUT mode. Observations are read sequentially, but you are not allowed to revisit an observation. |
Default | I |
specifies a consistently increasing number that identifies one of the historical versions in a generation group.
Tip | The generation-number argument is ignored if type = F. |
is a character constant and can be one of the following values:
specifies that the first argument, data-set-name, is a one-level or two-level data set name. The following example shows how the D type value can be used:
rc = open('lib.mydata', , , 'D');
Tip | D is the default if there is no fourth argument. |
specifies that the first argument, data-set-name, is a filename, a physical path to a file.The following examples show how the F type value can be used:
rc = open('c:\data\mydata.sas7bdat', , , 'F'); rc = open('c:\data\mydata', , , 'F');
Tip | If you use the F value, then the third argument, generation-number, is ignored. |
Note | If an argument is invalid, OPEN returns 0. You can obtain the text of the corresponding error message from the SYSMSG function. Invalid arguments do not produce a message in the SAS log and do not set the _ERROR_ automatic variable. |
%let choice = style="RANCH"; %let dsid=%sysfunc(open(sasuser.houses (where=(&choice)),i));