Skip directly to local search Skip directly to A to Z list Skip directly to navigation Skip directly to site content Skip directly to page options
CDC Home
Share
Compartir

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 2012 data, and another is used for all the SHPPS 2006 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.

 

 
 
Contact Us:
  • Adolescent and School Health
    Centers for Disease Control and Prevention
    4770 Buford Hwy, NE
    MS K-29
    Atlanta, GA 30341
  • 800-CDC-INFO
    (800-232-4636)
    TTY: (888) 232-6348
  • Contact CDC-INFO
USA.gov: The U.S. Government's Official Web PortalDepartment of Health and Human Services
Centers for Disease Control and Prevention   1600 Clifton Rd. Atlanta, GA 30333, USA
800-CDC-INFO (800-232-4636) TTY: (888) 232-6348 - Contact CDC–INFO
A-Z Index
  1. A
  2. B
  3. C
  4. D
  5. E
  6. F
  7. G
  8. H
  9. I
  10. J
  11. K
  12. L
  13. M
  14. N
  15. O
  16. P
  17. Q
  18. R
  19. S
  20. T
  21. U
  22. V
  23. W
  24. X
  25. Y
  26. Z
  27. #