PROC CONTENTS In SAS is used to summarize a dataset's contents and metadata, generated summary about the contents of a dataset includes :
- All variable names, their types, and attributes of Variables (including formats, informats, and labels)
- Display the Number of Observation in Dataset
- Number of Variables in Dataset
- When the dataset was created
- And lot more Information about any Dataset
Syntax for PROC CONTENTS
Example-
PROC Contents Data=SASHELP.cars;title 'The Contents of the CARS Data Set';run;
Available Options for PROC CONTENTS
DIRECTORY
prints a list of all tables in the specified library.
prints a list of all tables in the specified library.
DETAILS | NODETAILS
Print additional Details of All Tables, This Details Option is always used along with Directory option.
Default | If DETAILS and NODETAILS are not specified, the default value option considered as NODETAILS |
Example-
PROC Contents Data=SASHELP.cars DIRECTORY DETAILS; title 'The Contents of the CARS Data Set';run;
PROC Contents Data=SASHELP.cars DIRECTORY DETAILS;title 'The Contents of the CARS Data Set';run;
OUT=table-name
Store the Output in a specified Table/Dataset, OUT= does not suppress the printed output from the statement. If you want to suppress the printed output, you must use the NOPRINT option.
Store the Output in a specified Table/Dataset, OUT= does not suppress the printed output from the statement. If you want to suppress the printed output, you must use the NOPRINT option.
Example-
NOPRINT
NOPRINT OPTION use to suppresses printing the output of the CONTENTS procedure.
SHORT
prints only the list of variable names for the table, If the list of variables is more than 32,767 characters, the list is truncated and a WARNING is written to the log. To get a complete list of the variables, request an alphabetical listing of the variables.
prints only the list of variable names for the table, If the list of variables is more than 32,767 characters, the list is truncated and a WARNING is written to the log. To get a complete list of the variables, request an alphabetical listing of the variables.
Example-
PROC Contents Data=SASHELP.cars SHORT; title 'The Contents of the CARS Data Set';run;
PROC Contents Data=SASHELP.cars SHORT;title 'The Contents of the CARS Data Set';run;
VARNUM
prints a list of the variable names in the order of their logical position in the table. The physical position of the variable in the table is engine-dependent.
prints a list of the variable names in the order of their logical position in the table. The physical position of the variable in the table is engine-dependent.
Example-
ORDER=COLLATE | CASECOLLATE | IGNORECASE | VARNUM
COLLATE
prints a list of variables in alphabetical order beginning with uppercase and then lowercase names.
CASECOLLATE
prints a list of variables in alphabetical order even if they include mixed-case names and numerics.
IGNORECASE
prints a list of variables in alphabetical order ignoring the case of the letters.
VARNUM
is the same as the VARNUM option.
Note | The ORDER= option does not affect the order of the OUT= table. |
0 Comments
If you have any doubt please comment or write us to - admin@datahark.com