Showing posts with label Proc Contents. Show all posts
Showing posts with label Proc Contents. Show all posts

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

Thursday, March 21, 2013

Base SAS Example Question 2.1

Be sure to leave a comment to the free Base SAS exam question listed below. I'll post the solution in a week or two. Good luck!

-SAS Cert

---------------------------------------------

What keyword should be used in the blank below to list the dataset's variables in logical, not alphabetical order?

proc contents data=air.organics ___;
run;

a) log
b) logical
c) varnum
d) var