Task 1: Merge Datasets

Step 1: Run program

Download, open and run the program: SAS Medicare

Program to merge Feasibility and Demographic Files

Explanation of SAS Code to merge Feasibility and Demographic 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.
data temp; Creates a temporary SAS dataset, temp.
set nhanes.nhanes_99_00_eligibility_Medicare; Reads in the NHANES 1999-2000 Medicare feasibility data.
proc sort data=temp;
  by SEQN;
run;
Sorts the temp dataset by the variable SEQN.
proc sort data=nhanes.demo;
  by SEQN;
run;
Sorts the NHANES demographic dataset by the variable SEQN.
data nhanes.merg9900_Medicare;
  merge temp
        nhanes.demo;
  by SEQN;