Here are the steps to save an NHANES dataset:
In order to save a temporary dataset as a permanent dataset in a SAS library, you will need to use the DATA and SET statements. The sample code below, which comes from the “Supplement” program, shows how to save the temporary dataset, DEMOOST, as a permanent SAS dataset, called OSTEO_ANALYSIS_DATA. This permanent dataset will be saved in the SAS library, NH, which was created in the Download Data Files Module (please note that if you set up your file structure differently than what was presented in that module, you will need to adjust your SAS program accordingly).
*---------------------------------------------------------------------;
* Use the LIBNAME statement to specify the SAS library that
your ;
* permanent dataset will be saved to (NH). Use the DATA statement
to ;
* define the dataset that will be stored in the NH library. Use
the ;
* SET statement to refer to the temporary dataset.
;
*---------------------------------------------------------------------;
libname
NH
"C:\NHANES\DATA" ;
NH.OSETO_ANALYSIS_DATA;
set
DEMOOSTS;
;
To check that your dataset was saved to the NH library:
Double-click on NH library .The contents of NH library will be displayed in the right-hand window labeled "Contents" and should include your new permanent dataset, OSTEO_ANALYSIS_DATA.