Skip Navigation Links
Centers for Disease Control and Prevention
 CDC Home Search Health Topics A-Z

National Center for Chronic Disease Prevention and Health Promotion

Healthy Youth





SHPPS
How do I use the SAS format library?

The SAS format library contains the formats used to make SAS output more readable. Formats are linked to the data so results are displayed as words (“Yes” or “No”, for instance) instead of numbers (1 or 2). The SAS SHPPS data files are designed to use the companion format library. You should download both the data file and the format library if you want to use SAS to analyze SHPPS data. One format library is used for all the SHPPS 2006 data, and another is used for all the SHPPS 2000 data.

The following example SAS program shows how to use the format library. It assumes that both the data file and the format library have been downloaded to “c:\data”. Note that the program contains two libname statements. The first libname statement indicates where the data file is located; the second libname statement indicates where the format library is located.

General example:

libname mydata 'c:\data'; /* tells SAS where the data are */
libname library 'c:\data'; /* tells SAS where the formats are */

proc freq data=mydata.<name of SAS data file>;
tables <variable name>;
run;

SHPPS specific example using the district level health education data and running a table for the variable HED1:

libname mydata 'c:\data'; /* tells SAS where the data are */
libname library 'c:\data'; /* tells SAS where the formats are */

proc freq data=mydata hlthedd;
tables HED1;
run;

Using the format library is recommended but technically is optional. If you do not want to use the format library, include the following statement at the start of your SAS program:

options nofmterr; /*  tells SAS to not look for formats */

Please note that each year of SHPPS data has its own format library.

For further information on using format libraries, please refer to the documentation provided with the SAS system.

 

Documents on this page are available in Portable Document Format (PDF). Learn more about viewing and printing these documents with Acrobat Reader.





Healthy Youth Home | Contact Us

CDC Home | Search | Health Topics A-Z

Policies and Regulations | Disclaimers

Page last reviewed: October 1, 2007
Page last modified: October 1, 2007
Content source: National Center for Chronic Disease Prevention and Health Promotion, Division of Adolescent and School Health

Division of Adolescent and School Health
National Center for Chronic Disease Prevention and Health Promotion
Centers for Disease Control and Prevention
Department of Health and Human Services