Functions and CALL Routines |
Category: | SAS File I/O |
Syntax | |
Arguments | |
Examples | |
See Also |
Syntax |
ATTRN(data-set-id,attr-name) |
specifies the data set identifier that the OPEN function returns.
is the name of the SAS data set attribute whose numeric value is returned. 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:
specifies whether a password is required to alter the data set.
1 | |
0 |
specifies whether the engine knows the number of observations.
1 | |
0 |
specifies whether the data set has observations or variables.
-1 | |
0 | |
1 |
Alias: | VAROBS |
specifies whether the engine supports random access.
1 | |
0 |
Alias: | RANDOM |
specifies whether the engine can manipulate files.
1 |
the engine is not read-only. It can create or update SAS files. |
0 |
specifies whether logging to an audit file is enabled.
1 | |
0 |
specifies whether after-update record images are stored.
1 | |
0 |
specifies whether before-update record images are stored.
1 | |
0 |
specifies whether unsuccessful after-update record images are stored.
1 | |
0 |
specifies the date that the data set was created. The value that is returned is the internal SAS datetime value for the creation date.
Tip: | Use the DATETIME. format to display this value. |
returns information about the existence of integrity constraints for a SAS data set.
0 | |
1 | |
2 | |
3 |
both one or more general integrity constraints and one or more referential integrity constraints. |
specifies whether the data set supports indexing.
1 | |
0 |
specifies whether the data set is indexed.
1 | |
0 |
specifies whether the data set is a subset.
1 | |
0 |
specifies whether an application checks return codes.
1 | |
0 |
specifies the last date and time that the data set was modified. The value returned is the internal SAS datetime value.
Tip: | Use the DATETIME. format to display this value. |
specifies the number of observations in the data set that are marked for deletion.
specifies the number of logical observations (the observations that are not marked for deletion). An active WHERE clause does not affect this number.
-1 |
specifies the number of logical observations (the observations that are not marked for deletion) by forcing each observation to be read and by taking the FIRSTOBS system option, the OBS system option, and the WHERE clauses into account.
specifies the number of physical observations (including the observations that are marked for deletion). An active WHERE clause does not affect this number.
-1 |
specifies whether a password is required to access the data set.
1 | |
0 |
specifies whether access by observation number (radix addressability) is allowed.
1 | |
0 |
specifies whether a password is required to read the data set.
1 | |
0 |
specifies the status of the data set tape.
1 | |
0 |
specifies the active WHERE clauses.
0 | |
1 | |
2 | |
3 |
specifies whether a password is required to write to the data set.
1 | |
0 |
Examples |
This example checks whether a WHERE clause is currently active for a data set.
%let iswhere=%sysfunc(attrn(&dsid,whstmt)); %if &iswhere %then %put A WHERE clause is currently active.;
This example checks whether a data set is indexed.
data _null_; dsid=open("mydata"); isindex=attrn(dsid,"isindex"); if isindex then put "data set is indexed"; else put "data set is not indexed"; run;
This example checks whether a data set is protected with a password.
data _null_; dsid=open("mydata"); pw=attrn(dsid,"pw"); if pw then put "data set is protected"; run;
See Also |
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.