![]() Chapter Contents |
![]() Previous |
![]() Next |
| The DATASETS Procedure |
| Reminder: | You can use data set options with the BASE= and DATA= options. See Statements with the Same Function in Multiple Procedures for details. You can also use any global statements as well. See Global Statements for a list. |
| Featured in: | Describing a SAS Data Set |
| CONTENTS<option(s)>; |
| To do this | Use this option | |
|---|---|---|
| Specify the input data set | DATA= | |
| Specify the name for an output data set | OUT= | |
| Specify the name of an output data set to contain information about indexes and constraints | OUT2= | |
| Include information in the output about the number of observations, number of variables, and data set labels | DETAILS|NODETAILS | |
| Print a list of the SAS files in the SAS data library | DIRECTORY | |
| Print the length of a variable's informat or format | FMTLEN | |
| Restrict processing to one or more types of SAS files | MEMTYPE= | |
| Suppress the printing of individual files | NODS | |
| Suppress the printing of the output | NOPRINT | |
| Print a list of the variables by their position in the data set | VARNUM | |
| Print abbreviated output | SHORT | |
| Print centiles information for indexed variables | CENTILES | |
| Options |
contents data=HtWt;To obtain the contents of a specific generation file, use the following CONTENTS statement:
contents data=HtWt(gennum=3);
| Default: | most recently created data set in your job or session, from any SAS data library |
| Tip: | If you specify a read-protected data set in the DATA= option but do not give the read password, by default the procedure looks in the PROC DATASETS statement for the read password. However, if you do not specify the DATA= option and the default data set (last one created in the session) is read protected, the procedure does not look in the PROC DATASETS statement for the read password. |
| Featured in: | Describing a SAS Data Set |
| Default: | first defaults to DETAILS option in PROC DATASETS statement, then to the DETAILS system option setting. |
| See also: | description of these additional columns in "Options" in PROC DATASETS Statement |
MEMTYPE= in the CONTENTS statement differs from MEMTYPE= in most of the other statements in the DATASETS procedure in the following ways:
Specifying the MEMTYPE= option in the PROC DATASETS statement affects the CONTENTS statement only if you specify the _ALL_ keyword in the DATA= option. For example, the following statements produce the contents of only the SAS data sets with member type DATA:
proc datasets memtype=data; contents data=_all_; run;
| Aliases: | MT=, MTYPE= |
| Default: | DATA |
| Tip: | OUT= does not suppress the printed output from the statement. If you want to suppress the printed output, you must use the NOPRINT option. |
| See also: | The OUT= Data Set for a description of the variables in the OUT= data set. |
| See also: | The OUT2= Data Set for a description of the variables in the OUT2= data set. |
| Using the CONTENTS Procedure Instead of the CONTENTS Statement |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.