2: Accessing Data Flashcards
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,E,F
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.
B
Birth_Date is a numeric column, and all numeric columns in SAS are 8 bytes by default.
Which of the following tables is available at the beginning of a new SAS session?
a. sales b. work.newsalesemps c. sashelp.class
C
The Sashelp library contains sample and resource tables provided by SAS. The library is automatically available when SAS starts.
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
B
Missing numeric values are represented with a period, so Employee_ID must be a numeric column.
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
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.
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";
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.
Which library name (libref) is valid?
a. 2010Car b. car/2010 c. car2010 d. cars_2010
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.
To disassociate a libref that you previously assigned, you can use the UNASSIGN option in the LIBNAME statement.
a. True b. False
B
Use the CLEAR option in the LIBNAME statement to disassociate an assigned libref.
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.
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.
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
The descriptor portion of a SAS table includes the table metadata.
Which LIBNAME statement has the correct syntax?
a. libname reports “filepath/workshop”;
b. libname orion filepath/workshop;
c. libname 3456a “filepath/workshop”;
A
The libref must start with a letter or an underscore and contain eight characters maximum. The path must also be in quotation marks.