DATASETS Procedure

Tips: Supports RUN-group processing.

Supports the Output Delivery System. For details, see Output Delivery System: Basic Concepts in SAS Output Delivery System: User's Guide.

See: For more information, see Statements with the Same Function in Multiple Procedures. You can also use any global statement. For a list, see Global Statements in SAS Statements: Reference.

DATASETS Procedure under Windows, UNIX, z/OS

Syntax

PROC DATASETS <<option-1 <...option-n>>>;
AGE current-name related-SAS-file-1 <...current-name related-SAS-file-n>
</ <ALTER=alter-password> <MEMTYPE=mtype>>;
APPEND BASE=<libref.>SAS-data-set
<APPENDVER=V6>
<DATA=<libref.>SAS-data-set>
<FORCE>
<GETSORT>
<NOWARN>;
AUDIT SAS-file <(SAS-password)<GENNUM=integer>)>;
INITIATE <AUDIT_ALL=NO | YES>;
LOG<ADMIN_IMAGE=YES | NO>
<BEFORE_IMAGE=YES | NO>
<DATA_IMAGE=YES | NO>
<ERROR_IMAGE=YES | NO>;

<SUSPEND | RESUME | TERMINATE; >
<USER_VAR variable-1 <...variable-n>>;
CHANGE old-name-1=new-name-1
<…old-name-n=new-name-n >
</ <ALTER=alter-password> <GENNUM=ALL | integer><MEMTYPE=mtype>>;
CONTENTS <option-1 <...option-n>>;
COPY OUT=libref-1
<CLONE | NOCLONE>
<CONSTRAINT=YES | NO>
<DATECOPY>
<FORCE>
<IN=libref-2>
<INDEX=YES | NO>
<MEMTYPE=(mtype-1 <...mtype-n>)>
<MOVE <ALTER=alter-password>>
<OVERRIDE ds_option-1=value-1 <...ds_option-n=value-n>>;
EXCLUDE SAS-file-1 <...SAS-file-n> < / MEMTYPE=mtype>;
SELECT SAS-file-1 <...SAS-file-n>
</ <ALTER=alter-password>
<MEMTYPE= mtype>>
;
DELETE SAS-file-1 <...SAS-file-n>
</ <ALTER=alter-password><GENNUM=ALL | HIST | REVERT | integer>
<MEMTYPE=mtype>>
;
EXCHANGE name-1=other-name-1
<…name-n=other-name-n>
</ <ALTER=alter-password><MEMTYPE=mtype> >;
MODIFY SAS-file <(option-1 <...option-n>)>
</ <CORRECTENCODING=encoding-value> <DTC=SAS-date-time>
<GENNUM=integer><MEMTYPE=mtype>>
;
ATTRIB variable list(s) attribute list(s);
FORMAT variable-1 <format-1>
<…variable-n <format-n>>;
IC CREATE <constraint-name=> constraint
<MESSAGE='message-string' <MSGTYPE=USER>>;
IC DELETE constraint-name-1 <...constraint-name-n> | _ALL_;
IC REACTIVATE foreign-key-name REFERENCES libref;
INDEX CENTILES index-1 <...index-n>
</ <REFRESH><UPDATECENTILES= ALWAYS | NEVER | integer>>;
INDEX CREATE index-specification-1 <...index-specification-n>
</ <NOMISS><UNIQUE> <UPDATECENTILES=ALWAYS | NEVER | integer>>;
INDEX DELETE index-1 <...index-n> | _ALL_;
INFORMAT variable-1 <informat-1>
<…variable-n <informat-n>>;
LABEL variable-1=<'label-1' | ' '>
<…variable-n=<'label-n' | ' ' >>;
RENAME old-name-1=new-name-1
<…old-name-n=new-name-n>;
REBUILD SAS-file </ ALTER=password GENNUM=n MEMTYPE=mtype NOINDEX>;
REPAIR SAS-file-1 <...SAS-file-n>
</ <ALTER=alter-password> <GENNUM=integer><MEMTYPE=mtype>>;
SAVE SAS-file-1 <...SAS-file-n> </ MEMTYPE=mtype>;

Table of Procedure Tasks

Statement Task Example
PROC DATASETS Statement Manage SAS files  
AGE Statement Rename a group of related SAS files Ex. 7
APPEND Statement Add observations from one SAS data set to the end of another SAS data set Ex. 8, Ex. 6, Ex. 9
ATTRIB Statement Associates a format, informat, or label with variables in the SAS data set specified in the MODIFY statement Ex. 1
AUDIT Statement Initiate, control, suspend, resume, or terminate event logging to an audit file  
CHANGE Statement Rename one or more SAS files Ex. 2
CONTENTS Statement Describe the contents of one or more SAS data sets and prints a directory of the SAS library Ex. 9, Ex. 5, Ex. 10
COPY Statement Copy all or some of the SAS files Ex. 2
DELETE Statement Delete SAS files Ex. 2
EXCHANGE Statement Exchange the names of two SAS files Ex. 2
EXCLUDE Statement Exclude SAS files from copying Ex. 2
FORMAT Statement Permanently assign, change, and remove variable formats Ex. 4
IC CREATE Statement Create an integrity constraint  
IC DELETE Statement Delete an integrity constraint  
IC REACTIVATE Statement Reactivate a foreign key integrity constraint  
INDEX CENTILES Statement Update centiles statistics for indexed variables  
INDEX CREATE Statement Create simple or composite indexes Ex. 4
INDEX DELETE Statement Delete one or more indexes  
INFORMAT Statement Permanently assign, change, and remove variable informats Ex. 4
LABEL Statement Assign, change, and remove variable labels Ex. 4
MODIFY Statement Change the attributes of a SAS file and the attributes of variables Ex. 4
REBUILD Statement Specifies whether to restore or delete the disabled indexes and integrity constraints  
RENAME Statement Rename variables in the SAS data set Ex. 4
REPAIR Statement Attempt to restore damaged SAS data sets or catalogs  
SAVE Statement Delete all the SAS files except the ones listed in the SAVE statement Ex. 3
SELECT Statement Select SAS files for copying Ex. 2