03-12-2018 06:15 PM
I am struggling to download, save, and import a dataset into SAS. I want to import each year of the NHIS (CDC's National Health Interview Survey) Sample Child files into SAS to do a proc surveyfreq.
I'm trying the 2013 data release...
Download data set:
1. Go to
2. Click on "Data Files" drop down menu
3. Find "Sample Child File"
4. Click on ASCII zip file (this is the data file that downloads and saves into my H - drive.
Because it's a .dat file, my code cannot read it in SAS.
This is the code I'm trying...
Proc Import OUT=work.childsample2013
This code works fine for the NHIS data from 2016 because its available in an excel file.
Proc Import out=work.childsample
03-12-2018 06:28 PM
Perhaps you should examine the files on the site named "Sample SAS Statements" for each section. The file will have code on how to read the file as well as formats.
You would have to modify the code to point to your file paths for in the infile and libname statements.
03-12-2018 07:11 PM
Do you know if the newer SAS can open zip files?
Yes but limited to files created with WinZip and you couldn't execute the SAS code from inside the ZIp if that is what you are thinking. For one thing the paths in the NHIS code are almost certain not to match yours.