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.
Get email updates
To receive email updates about this page, enter your email address:
Contact Us:
- Adolescent and School Health
Centers for Disease Control and Prevention
4770 Buford Highway, Northeast, Mailstop K-27
Atlanta, GA 30341 - 800-CDC-INFO
(800-232-4636)
TTY: (888) 232-6348
Hours of Operation
8am-8pm
ET/Monday-Friday
Closed Holidays - Contact CDC-INFO


