SAS Homework 1
Please submit the homework through the Blackbord
Question 1
The data file “School” contains 3 variables and 6 observations. It contains the information about the number of students and teachers in each grade. Import this data file into your SAS software, and paste your SAS code here and screen shoot the Viewtable of the data set in the SAS.
Question 2
The data file “Age” contains three variables and five observations. The three variables’ names are Name, Age, and Weight. Read this data file into your SAS software, paste your SAS code here, and screen shoot the Viewtable of the data set in the SAS.
Question 3
The data file “Days” contains the information about the number of rainy days, cloudy days, and sunny days on last June for five countries. There are multiple observations in one line of data. Read this data file into your SAS software, paste your SAS code here, and screen shoot the Viewtable of the data set in the SAS.
Question 4
The data file “Days2” contains the information about the number of rainy days, cloudy days, and sunny days on last June for five countries. The data of one observation spread over multiple lines. Read this data file into your SAS software, paste your SAS code here, and screen shoot the Viewtable of the data set in the SAS.
Question 5
Which of the following statements in the DATA step reads the data file, and only reads data lines 1-20?
A. INFILE "Computer-path-field" FIRSTOBS=20;
B. INFILE "Computer-path-field" OBS=20;
C. INPUT "Computer-path-field" FIRSTOBS=20;
D. INPUT "Computer-path-field" OBS=20;
Question 6
Which of the following statement is true?
A. CARDS and DATALINES perform different actions in typing data directly into SAS.
B. INFILE "Computer-path-field" OBS=15; This statement read first 15 observations of data into SAS.
C. In the PROC IMPORT, DBMS option for the text data file is TXT.
D. In the PROC IMPORT, DBMS option for the csv data file is CSV.
Name XXXXXXXXXXAge Weight
Jason Wang XXXXXXXXXX
Mary Lee XXXXXXXXXX
Jack Brown XXXXXXXXXX
Joe Yi XXXXXXXXXX
Jonathan Blacks 17 180
Country XXXXXXXXXXCountry2 18
2 10 Country XXXXXXXXXXCountry4 9
11 10 Country XXXXXXXXXX
Country1
22
3
5
Country2
18
2
10
Country3
13
12
5
Country4
9
11
10
Country5
1
2
27