Returns the value of a character attribute for a SAS data set.
Category: | SAS File I/O |
specifies the data set identifier that the OPEN function returns.
is the name of a SAS data set attribute. If the value of attr-name is invalid, a missing value is returned. The following is a list of SAS data set attribute names and their values:
returns a value for the character set of the computer that created the data set.
empty string | Data set not sorted |
ASCII | ASCII character set |
EBCDIC | EBCDIC character set |
ANSI | OS/2 ANSI standard ASCII character set |
OEM | OS/2 OEM code format |
returns 'YES' or 'NO' depending on whether the SAS data set is encrypted.
returns the name of the engine that is used to access the data set.
returns the label assigned to the data set.
returns the libref of the SAS library in which the data set resides.
returns the SAS data set name.
returns the mode in which the SAS data set was opened, such as:
I | INPUT mode allows random access if the engine supports it. Otherwise, it defaults to IN mode. |
IN | INPUT mode reads sequentially and allows revisiting observations. |
IS | INPUT mode reads sequentially but does not allow revisiting observations. |
N | NEW mode creates a new data set. |
U | UPDATE mode allows random access if the engine supports it. Otherwise, it defaults to UN mode. |
UN | UPDATE mode reads sequentially and allows revisiting observations. |
US | UPDATE mode reads sequentially but does not allow revisiting observations. |
V | UTILITY mode allows modification of variable attributes and indexes associated with the data set. |
returns the SAS library member type.
returns an empty string if the data set is not sorted. Otherwise, it returns the names of the BY variables in the standard BY statement format.
returns a value that indicates how a data set was sorted:
Empty string | Data set is not sorted. |
WEAK | Sort order of the data set was established by the user (for example, through the SORTEDBY data set option). The system cannot validate its correctness, so the order of observations cannot be depended on. |
STRONG | Sort order of the data set was established by the software (for example, through PROC SORT or the OUT= option in the CONTENTS procedure). |
returns an empty string if the data set is sorted on the native computer or if the sort collating sequence is the default for the operating environment. Otherwise, it returns the name of the alternate collating sequence used to sort the file.
returns the SAS data set type.
data _null_; dsid=open("sasdata.sortcars","i"); charset=attrc(dsid,"CHARSET"); if charset = "" then put "Data set has not been sorted."; else put "Data set sorted with " charset "character set."; rc=close(dsid); run;