2: Accessing Data Flashcards

1
Q

Which column names are valid? Select all that apply.

 a. month6
 b. 6month
 c. month#6
 d. month 6
 e. month_6
 f. Month6
A

A,E,F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
In this PROC CONTENTS output, what is the default length of the Birth_Date column?
#	Variable	                         Type
4	Birth_Date	                 Num
3	Customer_Address	 Char
1	Customer_ID	                Num
2	Customer_Name	        Char
 a. 4 bytes
 b. 8 bytes
 c. 32,767 bytes
 d. It doesn't have a default length.
A

B

Birth_Date is a numeric column, and all numeric columns in SAS are 8 bytes by default.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following tables is available at the beginning of a new SAS session?

 a. sales
 b. work.newsalesemps
 c. sashelp.class
A

C
The Sashelp library contains sample and resource tables provided by SAS. The library is automatically available when SAS starts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In this table, what type of column is Employee_ID?
Obs Employee_ID Last Salary
1 . Ralston 29250
2 120101 Lu 163040
3 120104 Billington 46230
4 120105 Povey 27110
5 120106 Hornsey. .

 a. character
 b. numeric
 c. temporary
 d. missing
A

B

Missing numeric values are represented with a period, so Employee_ID must be a numeric column.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which statement about SAS dates is false?

 a. A SAS date is one of three SAS column types: numeric, character, and date.
 b. SAS dates represent the number of days from January 1, 1960.
 c. SAS date values can be positive or negative.
 d. SAS date values can be used in calculations.
A

A
SAS columns are either character or numeric. SAS date values are numeric values that represent the number of days before or after January 1, 1960.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which LIBNAME statement has the correct syntax for reading a Microsoft Excel file?

 a. libname excel "filepath/myexcelfile";
 b. libname mydata xlsx "filepath/myexcelfile";
 c. libname mydata xlsx "filepath/field_data.xlsx";
A

C
After the libref, the XLSX engine is specified. The full path to the Excel file, including the .xlsx file extension, must be provided in quotation marks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which library name (libref) is valid?

 a. 2010Car
 b. car/2010
 c. car2010
 d. cars_2010
A

C
This libref follows all three rules for valid librefs. A libref must have a length of one to eight characters, and must begin with a letter or underscore. The remaining characters must be letters, numbers, or underscores.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

To disassociate a libref that you previously assigned, you can use the UNASSIGN option in the LIBNAME statement.

 a. True
 b. False
A

B

Use the CLEAR option in the LIBNAME statement to disassociate an assigned libref.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does this code do?
proc import datafile=”d:/collect817/bird_count.csv”
dbms=csv out=bird817 replace;
run;

 a. It creates a SAS data set named bird817 in the work library from the CSV file bird_count and replaces bird817 whenever the CSV file is updated.
 b. It creates a SAS data set named bird817 in the work library from the CSV file bird_count.
 c. It uses the CSV engine to directly read the data file bird_count.csv.
A

B
This PROC IMPORT step creates a SAS data set from a CSV file. When the code runs, it replaces the SAS data set if it already exists.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
In which portion of a SAS data set are the following found?
name of the data set
type of the column Salary
creation date of the data set
	 a.  descriptor portion
	 b.  data portion
A

A

The descriptor portion of a SAS table includes the table metadata.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which LIBNAME statement has the correct syntax?

a. libname reports “filepath/workshop”;
b. libname orion filepath/workshop;
c. libname 3456a “filepath/workshop”;

A

A

The libref must start with a letter or an underscore and contain eight characters maximum. The path must also be in quotation marks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly