Wednesday, October 18, 2006

PROC SQL and the DESCRIBE TABLE Statement

You can use the DESCRIBE TABLE statement in PROC SQL to display information about a SAS dataset. The information is displayed in the log. Whether the data set described was created with a DATA step or PROC SQL, the log will display the CREATE TABLE statement required to create it.

If applicable, SAS data set options are included with the table definition. If indexes are defined on columns in the table, then CREATE INDEX statements for those indexes are also written to the SAS log.

Unlike PROC CONTENTS, the CREATE TABLE statement also displays the name of the SAS program used to create the data set.

Here is an example:

libname abc '/home/sas/data';
proc sql;
describe table abc.customers;
quit;

The resulting log shows the CREATE TABLE statement that would create abc.customers with PROC SQL.

1 Comments:

At 12:30 PM, Anonymous Wayne said...

I also suggest picking up a proc sql user guide which is an indispensible resource. Thanks for the information.

Proc SQL User Guide

 

Post a Comment

<< Home