1.2 Flashcards
Which of the following is NOT an example of structured data?
a) SAS tables
b) MS Access tables
c) comma-delimited files
d) Oracle DBMS tables
c) comma-delimited files are unstructured
True/False - JSON files are examples of unstructured data.
True - JSON files, text files, comma-delimited files, and weblogs are all examples of unstructured data
True/False - you can analyze and report on unstructured data in SAS.
False - you must import unstructured data into SAS before analyzing and reporting on it.
Which of the following is true regarding SAS tables?
a) the file extension is .sasbdat
b) there are two parts to a SAS table - a descriptor portion and a data portion
c) the data portion contains columns names
d) the descriptor portion contains data values
b) there are two parts to a SAS table - a descriptor portion and a data portion
a - the file extension is .sas7bdat
c & d - The descriptor portion contains the metadata, or the properties of the table, such as the name, the number of rows, and the date and time the table was created. The descriptor portion also includes column names and attributes. The data portion contains the data values, stored in columns.
Which of the following is NOT a required attribute of a SAS column:
a) a label
b) a name
c) a type
d) a length
a) a label
True/False - SAS column names can be 1 to 36 characters long.
False - SAS columns names can be 1 to 32 characters long.
True/False - SAS column names must start with a letter or underscore.
True - SAS column names must start with a letter or underscore.
True/False - SAS columns are stored in uppercase by default.
False - Column names are stored in the case that you use when you create the column and can be in uppercase, lowercase, or mixed case.
True/False - Special symbols and spaces cannot be used in SAS column names.
False - Depending on the environment you use to submit your code, SAS might allow for spaces and special symbols other than underscores in column and table names. If you use data sources other than SAS that have flexible column name rules, SAS can make allowances for that, however, it’s recommended to follow the SAS naming conventions.
Which of the following are SAS column attribute Types:
a) numeric
b) character
c) date
d) a & b
e) a, b & c
d) numeric and character (SAS dates are a particular kind of numeric value).
Which of the following statements are true?
a) numeric columns can only store numeric values, which can include the digits 0 through 9, a minus sign, and a single decimal point.
b) Character columns can store only letters
c) Character columns store SAS dates
d) Character columns can store, letters, numbers, special characters and blanks.
d) Character columns can store, letters, numbers, special characters and blanks.
a - numeric columns can only store numeric values, which can include the digits 0 through 9, a minus sign, and a single decimal point. Can also hold E for scientific notation.
Which of the following is NOT true regarding SAS dates?
a) SAS stores date values as the number of days between January 1, 1960 and a specific date.
b) Dates before January 1, 1960 are stored as negative values.
c) You must use special functions to accommodate leap years when programming SAS.
d) There are numerous ways to display numeric date values so they look like dates you can understand.
c) You must use special functions to accommodate leap years when programming SAS.
Which column names below follow SAS naming conventions (select all that apply)?
a) month6
b) 6month
c) month#6
d) month 6
e) month_6
f) Month6
a) month6, e) month_6, and f) Month6
According to SAS naming conventions, column names cannot start with a number and cannot include blanks or special characters.
Which of the following is true regarding the PROC CONTENTS procedure?
a) It generates a report of the data portion of the table.
b) It provides summary statistics for numeric variables by default
c) It gives general information about the table, including where the table is stored, when it was created and modified, and the number of rows and columns.
d) It produces a table called “Alphabetic List of Variables and Attributes”
e) c & d
e) c & d
a - It generates a report of the descriptor portion of the table
True/False - The following code will run without error.
proc contents data=”s:/workshop/data/class.sas7bdat”;
run;
True - assuming the class.sas7bdat exists in the directory listed. However, this hardcoding of the filepath is not recommended.
Which two pieces of information, necessary for reading SAS data, can you specify with a LIBNAME statement?
a) format and path
b) server and directory
c) engine and location
d) location and file type
d) location and file type
Which of the following is correct syntax for assigning a library?
a) LIBNAME libref engine “path”;
b) LIBNAME engine libref;
c) LIBNAME libref “path”;
d) LIBNAME name engine “path”;
a) LIBNAME libref engine “path”;
c - base is the default engine and is not necessary if the tables to be read are SAS tables, however, if they are not SAS tables the engine must be specified
Which of the following are true regarding the libref portion of the LIBNAME statement?
a) The libref is the name of the library.
b) The libref must be eight characters or less.
c) The libref must start with a number
d) The libref can include only letters, numbers, and underscores in the name.
e) a, b, and d
e) a, b and d
c - the libref statement must start with either a letter or underscore
How many characters can a libref be in length?
a) 1 to 32
b) 1 to 36
c) 1 to 8
d) unlimited
c) 1 to 8
True/False - When creating a library, you must specify a path that is relative to where SAS is running.
True - If SAS is on your local computer, you can specify a path to a folder on your computer. If SAS is on a remote server, the path or folder must be to a location relative to the server.
True/False - Once you create a SAS library in a program, it is permanent.
False - By default, a library, or libref, that you define remains active until you delete it or end your SAS session. When you restart SAS, you simply submit the LIBNAME statement again and then you can access your data.
Which of the following is NOT true regarding SAS libraries?
a) SAS automatically creates a Work library
b) SAS automatically defines the SASHELP library
c) The Work library will permanently save the tables you create in you program.
d) The Work library is the default library. If you don’t type a libref in front of a table name, SAS uses the Work library.
c) The Work library is temporary - tables written to the Work library are deleted at the end of each SAS Session.
Which of the following is correct syntax for using a library to read Excel files?
a) libname xlsx xlclass “s:/workshop/data/class.xlsx”;
b) libname xlclass xlsx “s:/workshop/data/class.xlsx”;
c) libname xlclass “s:/workshop/data/class.xlsx”;
d) libname xlclass xlsx “s:/workshop/data/class”;
b) libname xlclass xlsx “s:/workshop/data/class.xlsx”;
True/False - The Excel files in a directory is can be through of as a collection of tables.
False - Each Excel workbook must be assigned to a library and each individual worksheet is one table in the library.