Functions and CALL Routines |
Category: | SAS File I/O |
Syntax | |
Arguments | |
Examples | |
See Also |
Syntax |
ATTRC(data-set-id,attr-name) |
specifies the data set identifier that the OPEN function returns.
is an attribute name. If attr-name is invalid, a missing value is returned.
Valid values for use with attr-name are:
returns a value for the character set of the computer that created the data set.
empty string | |
ASCII | |
EBCDIC | |
ANSI | |
OEM |
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 libref of the SAS library in which the data set resides.
returns the mode in which the SAS data set was opened, such as:
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:
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.
Examples |
This example generates a message if the SAS data set has not been opened in INPUT SEQUENTIAL mode. The message is written to the SAS log as follows:
%let mode=%sysfunc(attrc(&dsid,MODE)); %if &mode ne IS %then %put Data set has not been opened in INPUT SEQUENTIAL mode.;
This example tests whether a data set has been sorted and writes the result to the SAS log.
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;
See Also |
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.