Task 1a: How to Save NHANES Datasets in SAS

Here are the steps to save an NHANES dataset:

 

Step 1: Save as permanent dataset

In this step, you will save the temporary SAS work file, called demo_BP4, as a permanent SAS dataset, called BP_analysis_data. This permanent dataset will be saved in your SAS library, called NH, which was created in the Download Data Files module. Please note that if your files have different names you must change the SAS program provided on the Download Programs & Datasets page accordingly.

 

Statements Explanation
libname NH "C:\NHANES\DATA"; Use the libname statement to specify the SAS library that your permanent dataset will be saved to.
data NH.BP_analysis_Data; Use the data statement to define a new dataset; BP_analysis_Data will be the name of your permanent data set in the NH library.
  set demo_BP4;

run;
Use the set statement to refer to the temporary dataset(s).

 

Step 2: Check that dataset was saved to permanent library

To check that your dataset was saved to the NH library:

  1. Open the SAS Explorer.
  2. When the Explorer opens, open the Library icon.
  3. 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, BP_analysis_data.

 

close window icon Close Window