Task 1: Create SAS-formatted Feasibility File: Medicare

Step 1

Download, open and run the SAS program: “SAS Medicare” from the link below. This program reads the data and converts it to SAS formatted files.

Program to create NHANES Feasibility File from raw data.

Info icon Information

A regular left-click may not download the SAS datasets or SAS code correctly. Your browser may try to open and attempt to interpret the contents of the dataset or program. If this happens, right-click the link and save the dataset or program to your hard drive. After the dataset or code has downloaded, use your statistical software program to open and view it.

Explanation of SAS Program to create NHANES Feasibility File from raw data
Statements Explanation
options ls=120 ps=42 missing=' ' nocenter validvarname=upcase compress=binary; Log/List options.  Compress option reduces storage requirements for output datasets.
libname nhanes 'C:\NHANES'; Provides location for reading and saving SAS datasets.
* Input File Reference *;
filename intext "C:\NHANES\MEDICARE_FEASIBILITY_NHANES_1999_2000.dat";
Provides location and name of flat file.
data nhanes.nhanes_99_00_elig_Medicare;
infile intext lrecl=142 ;
Creates a permanent SAS formatted file with feasibility data for NHANES 1999-2000.
* Lengths *;
           @  1 SEQN                5. 
           @ 15 CMS_MEDICARE_MATCH  1. ;
Defines length of variables in SAS dataset.
* Labels *;
     CMS_MEDICARE_MATCH = 'CMS Medicare Match Status';
Assigns descriptive labels to variables in SAS dataset.
* Keep *;
Specifies the variables to include in output SAS dataset.
proc contents data=nhanes.nhanes_99_00_elig_Medicare varnum; Lists the contents of  SAS dataset.  Varnum option prints the list of variables by their position in the dataset.
proc print data=nhanes.nhanes_99_00_eligib_Medicare (obs=10); Prints sample listing of first 10 records.
proc print data=nhanes.nhanes_99_00_eligib_Medicare (obs=10); Reports the number of observations, the mean, the standard deviation, the minimum value, and the maximum value for each numeric variable in the SAS dataset.

Step 2

Check the SAS log of the program to create NHANES Feasibility File from raw data [see results saved as Module 5_1a Sample Code Creating NHANES Feasibility SAS Data set from Raw Data Medicare.log]

Check that NHANES_99_00_elig_Medicare.sas7bdat has been created.

Check contents for three variables, PUBLICID, CMS_ MEDICARE_MATCH, and ON_CMS_FLAG by opening the SAS dataset, NHANES_99_00_elig_Medicare.sasb7dat.



close window icon Close Window to return to module page.