Biostatistics Consulting Center at University of Massachusetts, Amherst
Link 1 : Link 2Biostat & Epi : SPHHS : UMass
HOME

Contact Us
Resources
SAS Tools

Format cat.
Codebook
Missing Data

Grant Develop.
Data Unit

Stat. Consulting

TOP


STORING AND USING PERMANENT FORMATS FOR SAS DATASETS
This describes how to create formats for categorical variables in a permanent SAS dataset using a user defined catalog name, and how to combine different format data files to one catalog. We also talk about how to use the format catalog.

1) Make a permanent format catalog for your project data with a name specific to the project rather than the SAS default name: formats.sc2.

a) If you have no permanently stored formats already then create formats using code such as in the example: format1.sas.

b) If you already have formats stored in 1 or more SAS datasets from the cntlout command, then combine all the formats in a single catalog with code such as in the example: format2.sas

2) Using the format catalog

a) Tell SAS where to find the formats
SAS will automatically look for the formats in library.formats. Because you have now made a specific name for the format catalog you need to indicate where SAS should look for this in the options statement at the start of all your programs by including the fmtsearch option.

eg. options ps=72 ls=120 nocenter nonumber fmtsearch=(projecta.prjaform);

b) Prepare your datasets with permanent formats attached to variables.

eg. Your data includes variables
SEX "Are you male or female?" with responses 1=Male 2=Female
HOME "Do you own your home?" with responses 0=No 1=Yes
KIDS "Do you have any children?" with responses 0=No 1=Yes

Include a format statement in your data step with code such as format3.sas

Link 1 : Link 2Biostat & Epi : SPHHS : UMass

© 2004 University of Massachusetts Amherst. Site Policies.
This site is maintained by Biostatistics Consulting Center at University of Massachusetts, Amherst.
Send comments or questions about this web site to mzorn@schoolph.umass.edu.
This page was last modified on June 3, 2004.