Prepare Data
1. Download the dataset setup files from UC-UTCC Dataverse. Please follow UC-UTCC Dataverse user guide. Any question about UC-UTCC Dataverse, please contact Dataverse support email: rapeepong@dvn.utcc.ac.th
2. Please read and understand term of use before downloading each dataset. If you accept the term of use, make a checkbox “I agree and accept these terms of use” checked and click Continue button. Or not, click Cancel button.
3. Click Save button on the file download dialog box. And select the directory to save this file.
4. After downloading, you have to decompress the dataset setup files in your local computer. Figure 4 is just one of several ways to extract zip file in local computer. You can choose other solutions to extract file if you cannot follow this figure.
In Figure 4, we extract downloading file on the C drive.
5. Some dataset has a large size. So we have to separate the dataset into several parts. You don’t need to import all parts in SAS. Just import the interesting part to SAS for use.
For each part or dataset, there are many setup files and 1 ASCII data file. For SAS, we use only 2 files.
• A columnar ASCII data file (.txt)
• A SAS syntax file (.txt)
In Figure 5, we use these below files to import National Rural Development 2005 Part 1 (NRD2005 Part 1) to SAS. The path for reference is C:\NRD2005_setup_file\NRD2005_PART1
• NRD2005_PART1_DATA.txt
• NRD2005_PART1_setupSAS.txt
Import data to SAS
1. Open SAS program.
2. To open the SAS setup file, click on File -> Open.
Figure 7 Open menu
3. Select the SAS setup file in File Dialog box.
• Look in: Choose the path where the SAS setup file is located.
• File of type: Set type to All files.
• File name: Click on the SAS setup file. The name will appear after file name.
• Click Open button for open the SAS setup file.
In Figure 8, we choose the SAS setup file of National Rural Development 2005 Part 1 (NRD2005_PART1_setupSAS.txt). The path is C:\NRD2005_setup_file\NRD2005_PART1
4. SAS will display the file in the SAS Editor.
5. Enter the full path and name of the raw ASCII data file in SAS Editor.
• FILENAME INDATA -- Enter the full path and name of the raw ASCII data file.
• LIBNAME LIBRARY -- Enter the full path of the raw ASCII data file.
In Figure 10, we enter the full path and name of the raw ASCII data file for the National Rural Development 2005 Part 1. Commands should read:
FILENAME INDATA ‘C:\NRD2005_setup_file\NRD2005_PART1\NRD2005_PART1_DATA.txt’;
LIBNAME LIBRARY ‘C:\NRD2005_setup_file\NRD2005_PART1\’;
6. After editing the path, click on Run -> Submit to run command. The data will import to SAS program.
Figure 11 Submit command
7. After submit command, data will import to SAS program. You can see detail of the dataset in SAS Output.
8. To view the data, Click on Explorer tab.
Figure 13 Explorer tab
9. The data file will be located in the Work library. Click on Work icon in SAS Explorer.
Figure 14 Work library
10. You will see In data file in Work library. Click on In icon to view data.
Figure 15 Data file in Work library
11. You can see data in SAS View Table. Now data can be ready for analysis in SAS.
Reference
http://www.icpsr.umich.edu/cocoon/SAMHDA/FAQ/0056.xml
http://www.icpsr.umich.edu/cocoon/SAMHDA/FAQ/0061.xml
http://www.icpsr.umich.edu/cocoon/SAMHDA/FAQ/0127.xml
Author: Sirivimol Thanchalatudom
Reviewer: Phongkiat Koopkan

