Centers for Disease Control and Prevention


About N C H S graphic and link
Información en Español
Fastats A-Z provides health statistics and links to additional sources of information
N C H S help graphic and link
Coming Events graphic and link
Surveys and Data Collection Systems graphic and link
National Health and Nutrition Examination Survey graphic and link
National Health Care Survey graphic and link
National Health Interview Survey graphic and link
National Immunization Survey graphic and link
Longitudinal Studies of Aging (LSOAs)
National Survey of Family Growth graphic and link
State and Local Area Integrated Telephone Survey graphic and link
National Vital Statistics System graphic and link
Initiatives graphic and link
Aging Activities graphic and link
Disease Classification graphic and link
Healthy People graphic and link
Injury graphic and link
Research and Development graphic and link
Research Data Center
NCHS Press Room
News Releases graphic and link
Publications and Information Products graphic and link
Statistical Export and Tabulation System
Listserv graphic and link
Graphic and link to FEDSTATS and other sites
Download graphic
Adobe Acrobat Reader graphic and link
PowerPoint Viewer 2003 graphic and link
National Center for Health Statistics 3311 Toledo Road Hyattsville, Maryland 20782
Toll Free Data Inquiries 1-800-232-4636


CDC Home Search Health Topics A-Z
N C H S graphic and link to home page


National Health Interview
Survey (NHIS)
Celebrating the First 50 years:
1957 - 2007

NCHS Home | NHIS Home | Questionnaires, Datasets, and Related Documentation | 1997-2008 Data and Related Documentation | 1996-Prior Data and Related Documentation | NHIS on Disability | Coming EventsMethods | Reports | Data Linked to NHIS Data | Related Sites  | CDC/NCHS Privacy Policy Notice | Accessibility | Search NCHS | Contact us

6.3. Sample SAS Programs for Tobacco Related Data

This section provides information for data analysts who need to understand how the NHIS sample SAS program files are structured in order to use them in their own analyses of tobacco related data.  See Section 6.3.2 for a list of the program files for data files that contain tobacco use data.

6.3.1  Overview of NHIS Tobacco Related SAS Program Files

On this website, we have provided a list of SAS program files for the years that the NHIS contained questions on tobacco use.  The user can modify the sample SAS program files so that they read in only the variables related to an analysis of tobacco use

To be able to write a SAS program to analyze NHIS tobacco use data, the user needs to have the questionnaire, the codebook file and the data file available for the desired year(s).  To make it easier for the user, a sample SAS program is included on the NHIS website for each for data files released each year.  Similar programs are included for the SPSS and STATA statistical packages.  The information given here for the SAS statistical package applies to the other statistical packages also.

A SAS program file is a ASCII* text file that reads in an ASCII data file.  The ASCII data file is not specific to SAS, and can be read by the input section of any program written for any other statistical package.  For example, the sample SPSS and STATA programs provided on the NHIS website read in the same ASCII data file that the SAS program file accesses.

When the SAS statistical package runs the SAS program file provided, it creates a SAS dataset that the user can use as a temporary file, or can save as a permanent SAS dataset.  This technique permits the user to run the sample NHIS SAS program on any platform, with any version of SAS, and be assured that the correct SAS dataset will be created.

The first time the SAS program file is run, it does the following:

 Reads in the ASCII file (from column format), creates and saves a SAS dataset.

 Assigns variable names, labels and values, and creates a library that stores the resulting SAS formats.

 Runs 3 SAS procedures:  Proc contents, weighted frequencies, and unweighted frequencies.

The user can customize the program to: 1)use format statements rather than a stored library, 2)continue to read in an ASCII file rather than create a SAS dataset, 3)use other platforms than Windows, and 4)perform other analytic procedures not included in the sample program file.

The website links are not provided to the SAS program files because the files are handled differently, depending on whether or not SAS is accessible from the user’s computer.

 If SAS is not available, the user can use NOTEPAD or any other text editor to read or edit the program file.

 If SAS is available, going to the SAS program file and choosing the OPEN option automatically loads the file into the SAS editor.

 If SAS is available, but the user wishes to examine and modify the program file without loading it into SAS, the user can choose the SAVE option to use NOTEPAD or any other text editor to access the file.

* American Standard Code for Information Interchange (ASCII)

 Return to Introduction

 Return to Detailed Outline

 

This page last reviewed October 15, 2008

H H S Health and Human Services logo and link
U.S. DEPARTMENT OF HEALTH AND HUMAN SERVICES
Centers for Disease Control and Prevention
National Center for Health Statistics
Hyattsville, MD
20782

1-800-232-4636