Task 1: Create SAS-formatted Feasibility File: Medicaid

Step 1

Download, open and run the SAS program: “SAS Medicaid” 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\MEDICAID_FEASIBILITY_NHANES_1999_2000.dat";
Provides location and name of flat file.
data nhanes. nhanes_99_00_elig_Medicaid; Creates a permanent SAS formatted file with feasibility data for NHANES 1999-2000.
infile intext lrecl=60 ; Directs input statement to read an external file with logical record length=60. 
input 
@ 1 SEQN 5.
@15 CMS_MEDICAID_MATCH 1.;
Reads input values from specified columns and informats and assigns them to the corresponding SAS variables.
* Labels *;
label
SEQN = 'NHANES SEQN'
CMS_MEDICAID_MATCH = 'CMS Medicaid Match Status' ;
Assigns descriptive labels to variables in SAS dataset.
keep
SEQN
CMS_MEDICAID_MATCH;
Specifies the variables to include in output SAS dataset.
input @  1 PUBLICID  $CHAR14.
@ 15CMS_ MEDICAID_MATCH  1.
@ 16 ON_CMS_FLAG 1. ;
Reads input values from specified columns and informats and assigns them to the corresponding SAS variables.
Keep
PUBLICID
CMS_ MEDICAID_MATCH
ON_CMS_FLAG;
Specifies the variables to include in output SAS dataset.
proc contents data=nhanes.nhanes_99_00_elig_Medicaid 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_elig_Medicaid (obs=10); Prints sample listing of first 10 records.
proc means data=nhanes.nhanes_99_00_elig_Medicaid; 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 Medicaid.log]

Check that Nhanes_99_00_elig_NHANES.sas7bdat has been created. 

Check contents for three variables, SEQN and CMS_ MEDICAID_MATCH by opening the SAS dataset, NHANES_99_00_elig_NHANES.sasb7dat.

 

close window icon Close Window to return to module page.