Sunday, May 19, 2013

SAS Proc Contents

Below is a summary of the SAS Proc Contents procedure. You can pretty much guarantee that the Proc Contents procedure topic will show up somewhere on the Base SAS Certification exam, so be sure to read and understand this information thoroughly. It's an easy correct answer on the exam if you do!


Proc Contents Purpose:
Describes the contents of a library or the descriptor information for an individual SAS data set


Syntax:

PROC CONTENTS DATA=sas-data-library-or-data-set  (NODS) (VARNUM);
RUN;

***NODS and VARNUM are optional and their uses are described below


Other Important Points Worth Mentioning:
You can specify _ALL_ after a libref to show a detailed listing of all the files in the library

Example:
proc contents data=credit._all_;
run;


You can specify NODS to suppress detailed information about each file. You can only use this option when libref._ALL_ is specified.

In the example below, there are 3 datasets in the SAS library air - Organics, Reten7, and Scoredata.

Example:
proc contents data=air._all_ nods;
run;





The VARNUM option is used to list the variable names in their logical position (creation order) as opposed to alphabetical order.

Example:
proc contents data=credit.mortgage varnum;
run;


I hope this was helpful for you. Let me know what you think in the comments section and good luck studying!

-SAS Cert

2 comments:

  1. Difference between PROC CONTENTS and contents statement in PROC DATASETS ;
    CONTENTS ;
    QUIT;

    ReplyDelete
  2. Your battery life also varies primarily depending on the way you use your phone and the settings you have opted for. However, fast drain of Battery Watch Replacement Near Me over time is quite common. If your phone is not holding a charge, that means there is some problem that needs to be fixed immediately.

    ReplyDelete