Task 2: How to save NHANES data to a Microsoft Excel spreadsheet with SAS

In the SAS program that you have previouly created the following text can be inserted to save a portion of the data in an Excel spreadsheet.   

 

Program to save a portion of the NHANES data file to a Microsoft Excel spreadsheet

Ods html file =’C:\NHANES\ DATA \Results\Creatinine.xls’ style =journal;
proc print data =Phthalate ;
id seqn;
      var URXMHP URXUCR MHP_UCR;
title 'Check creatinine-corrected variable' ;
run ;
ods html close ;

 

Alternatively, you may save the whole data file into a permanent Excel file using the code below.

 

Program to save the entire NHANES data file to a Microsoft Excel spreadsheet

proc export data =Phthalate outfile = "c:\temp\Phthalatedata.xls" dbms =Excel2000 replace ;

run ;

 

close window icon Close Window