

















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















































13.2 What is an advantage of storing dates and times as SAS numeric date and time values? a. They can easily be edited. b. They can easily be read and understood. c. They can be used in text strings like other character values. d. They can be used in calculations like other numeric values. - correct answer ✅Correct answer: d In addition to tracking time intervals, SAS date and time values can be used in calculations like other numeric values 2.2 How many program steps are executed when the program below is processed? data user.tables; set work.jobs; run; proc sort data=user.tables; by name; run; proc print data=user.tables; run; A. 3 B. 4 C. 5 D. 6 - correct answer ✅Correct answer: a
When it encounters a DATA, PROC, or RUN statement, SAS stops reading statements and executes the previous step in the program. This program contains one DATA step and two PROC steps, for a total of three program step 2.5 With the system option VALIDVARNAME=ANY, which of the following variable names is valid? a. 4BirthDate b. $Cost c. Items d. Tax-Rate e. All of the above - correct answer ✅Correct answer: e If you use VALIDVARNAME=ANY, the name can begin with or contain any characters, including blanks, national characters, special characters, and multi-byte characters. The name can be up to 32 bytes long. The name must contain at least one character, and the variable name can contain mixed-case letters 2.6 Which of the following files is a permanent SAS file? a. Work.PrdSale b. Cert.MySales c. Certxl.Quarter d. only b and c above e. all of the above - correct answer ✅Correct answer: d To store a file permanently in a SAS data library, you assign it a libref. For example, by assigning the libref Cert to a SAS data library, you specify that files within the library are to be stored
The five statements are 1) the PROC PRINT statement (two lines long); 2) the VAR statement; 3) the WHERE statement (on the same line as the VAR statement); 4) the LABEL statement; and 5) the RUN statement (on the same line as the LABEL statement). 2.10 What is a SAS library? a. a collection of SAS files, such as SAS data sets and catalogs b. in some operating environments, a physical collection of SAS files c. a group of SAS files in the same folder or directory d. all of the above - correct answer ✅Correct answer: d Every SAS file is stored in a SAS library. A SAS library is a collection of SAS files, such as SAS data sets and catalogs. In some operating environments, a SAS library is a physical collection of files. In others, the files are only logically related. In the Windows and UNIX environments, a SAS library is typically a group of SAS files in the same folder or directory 3.1 How long do librefs remain in effect? a. until the LIBNAME statement is changed b. until the LIBNAME statement is canceled c. until the SAS session ends d. All of the above - correct answer ✅Correct answer: d Librefs remain in effect until the LIBNAME statement is changed, canceled, or until the SAS session ends 3.2 Which of the following statements are true?
a. When using the default engine, you do not have to specify the libref in the LIBNAME statement. b. When using the default engine, you do not have to specify the engine name in the LIBNAME statement. c. When using the default engine, you do not have to specify the SAS library in the LIBNAME statement. d. When using the default engine, you have to specify the libref, engine name, and the SAS library in the LIBNAME statement. - correct answer ✅Correct answer: b When you are using the default engine, you do not have to specify the engine name in the LIBNAME statement. However, you do have to specify the libref and the SAS data library name. 3.3 When you specify an engine for a library, what are you specifying? a. the file format for files that are stored in the library b. the version of SAS that you are using c. access to other software vendors' files d. instructions for creating temporary SAS files - correct answer ✅Correct answer: a A SAS engine is a set of internal instructions that SAS uses for writing to and reading from files in a SAS library. Each engine specifies the file format for files that are stored in the library, which in turn enables SAS to access files with a particular format. Some engines access SAS files, and other engines support access to other vendors' file 3.4 Which statement prints a summary of all the files stored in the library named Area51?
run; - correct answer ✅Correct answer: b Librefs must be 1 to 8 characters long, must begin with a letter or underscore, and can contain only numbers, letters, or underscores. After you assign a libref, you specify it as the first level in the two-level name for a SAS file 3.6 What type of information does the CONTENTS procedure create? a. the contents of a library b. descriptor information for an individual SAS data set c. both A and B d. none of the above - correct answer ✅Correct answer: c The CONTENTS procedure creates a report that contains the contents of a library or the descriptor information for an individual SAS data set. 3.7 Assuming you are using SAS code, which one of the following statements is false? a. LIBNAME statements can be stored with a SAS program to reference the SAS library automatically when you submit the program. b. When you delete a libref, SAS no longer has access to the files in the library. However, the contents of the library still exist on your operating system. c. Librefs can last from one SAS session to another. d. You can access files that were created with other vendors' software by submitting a LIBNAME statement. - correct answer ✅Correct answer: c
The LIBNAME statement is global, which means that librefs stay in effect until changed or canceled, or until the SAS session ends 3.8 What does the following statement do? libname states 'c:\myfiles\sasdata\popstats'; a. defines a library called States using the Popstats engine b. defines a library called Popstats using the States engine c. defines the default library using the default engines d. defines a library called States using the default engine - correct answer ✅Correct answer: d The LIBNAME statement does not specify an engine. Therefore, it uses a default engine to create the States library 4.1 Which SAS statement associates the fileref Crime with the raw data file C:\States \Data\crime.dat? a. filename crime 'c:\states\data\crime.dat'; b. filename crime c:\states\data\crime.dat; c. fileref crime 'c:\states\data\crime.dat'; d. filename 'c:\states\data\crime' crime.dat; - correct answer ✅Correct answer: a You assign a fileref by using a FILENAME statement in the same way that you assign a libref by using a LIBNAME statement 4.2 Which type of delimited file does PROC IMPORT read by default? a. logical record-length files
c. proc import datafile="c:\users\test.txt" out=exam dbms=dlm replace; run; proc print data=exam (obs=7); run; d. proc import datafile="c:\users\test.txt" out=exam dbms=dlm replace; run; proc print data=exam; options obs=7; run; - correct answer ✅Correct answer: a Use the OBS= option in the OPTIONS statement before the IMPORT procedure to limit the number of observations that SAS reads from the external file 4.4 Which of the following pieces of information does SAS need in the DATA step in order to read an Excel workbook file? a. a libref to reference the Excel workbook to be read b. the name and location (using another libref) of the new SAS data set c. the name of the Excel worksheet that is to be read
d. all of the above - correct answer ✅Correct answer: d To read an Excel workbook file, SAS must receive the following information in the DATA step: a libref to reference the Excel workbook to be read, the name and Chapter location (using another libref) of the new SAS data set, and the name of the Excel worksheet that is to be read 4.5 Which statement should you use if you want PROC IMPORT to generate SAS variable names from the data values in the first row of an input file? a. getnames=no; b. datarow=1; c. guessingrows=1; d. getnames=yes; - correct answer ✅Correct answer: d The GETNAMES statement specifies whether the IMPORT procedure generates SAS variable names from the data values in the first row in the input file 4.7 What does the SAS/ACCESS LIBNAME statement reference? a. a SAS library b. a tab-delimited text file c. a Microsoft Excel workbook d. a comma-delimited file - correct answer ✅Correct answer: c The SAS/ACCESS LIBNAME statement associates a SAS name with a Microsoft Excel workbook file by pointing to its location
by maxhr; run; proc print data=maxrates label double noobs; label rechr='Recovery Heart Rate; var resthr maxhr rechr date; where toler='I' and resthr>90; sum fee; run; a. SAS log messages indicate that the program ran successfully. b. A PROC SORT running message appears at the top of the active window, and a log message might indicate an error in a statement that seems to be valid. c. A SAS log message indicates that an option is not valid or not recognized. d. A PROC PRINT running message appears at the top of the active window, and a SAS log message might indicate that a quoted string has become too long or that the statement is ambiguous. - correct answer ✅Correct answer: d The missing quotation mark in the LABEL statement causes SAS to misinterpret the statements in the program 5.3 What generally happens when a syntax error is detected? a. SAS continues processing the step. b. SAS continues to process the step, and the SAS log displays messages about the error. c. SAS stops processing the step in which the error occurred, and the SAS log displays messages about the error.
d. SAS stops processing the step in which the error occurred, and the Output window displays messages about the error. - correct answer ✅Correct answer: c Syntax errors generally cause SAS to stop processing the step in which the error occurred 5.4 A syntax error occurs during the following actions: a. Some data values are not appropriate for the SAS statements that are specified in a program. b. The form of the elements in a SAS statement is correct, but the elements are not valid for that usage. c. Program statements do not conform to the rules of the SAS language. d. None of the above. - correct answer ✅Correct answer: c Syntax errors occur because the program statements did not conform to the rules of the SAS language 5.5 How can you tell whether you have specified an invalid option in a SAS program? a. A SAS log message indicates an error in a statement that seems to be valid. b. A SAS log message indicates that an option is not valid or not recognized. c. The message PROC STEP running or DATA STEP running appears at the top of the active window. d. You cannot tell until you view the output from the program. - correct answer ✅Correct answer: b
b. Recall the program. Then add a quotation mark and resubmit the corrected program. c. Cancel the submitted statements. Then recall the program, add a quotation mark, and resubmit the corrected program. d. Recall the program. Then replace the invalid option and resubmit the corrected program. - correct answer ✅Correct answer: c This program contains an unbalanced quotation mark. When you have an unbalanced quotation mark, SAS is often unable to detect the end of the statement in which it occurs 5.8 Suppose you submit a short, simple DATA step. If the active window displays the message DATA step running for a long time, what probably happened? a. You misspelled a keyword. b. You forgot to end the DATA step with a RUN statement. c. You specified an invalid data set option. d. Some data values were not appropriate for the SAS statements that you specified. - correct answer ✅Correct answer: b Without a RUN statement (or a following DATA or PROC step), the DATA step does not execute, so it continues to run 5.9 What types of errors can the PUTLOG statement help you resolve? a. syntax errors b. semantic errors c. logic errors
d. all of the above - correct answer ✅Correct answer: c A logic error occurs when the program statements follow the rules and execute, but the results are not correct 6.2 Which of the following PROC PRINT steps is correct if labels are not stored with the data set? a. proc print data=cert.totals label; label region8='Region 8 Yearly Totals'; run; b. proc print data=cert.totals; label region8='Region 8 Yearly Totals'; run; c. proc print data cert.totals label noobs; run; d. proc print cert.totals label; run; - correct answer ✅Correct answer: a You use the DATA= option to specify the data set to be printed. The LABEL option specifies that variable labels appear in output instead of in variable names 6.3 Which of the following statements selects from a data set only those observations for which the value of the variable Style is RANCH, SPLIT, or TWOSTORY? a. where style='RANCH' or 'SPLIT' or 'TWOSTORY'; b. where style in 'RANCH' or 'SPLIT' or 'TWOSTORY'; c. where style in (RANCH, SPLIT, TWOSTORY);
6.6 What happens if you submit the following program? proc sort data=cert.diabetes; run; proc print data=cert.diabetes; var age height weight pulse; where sex='F'; run; a. The PROC PRINT step runs successfully, printing observations in their sorted order. b. The PROC SORT step permanently sorts the input data set. c. The PROC SORT step generates errors and stops processing, but the PROC PRINT step runs successfully, printing observations in their original (unsorted) order. d. The PROC SORT step runs successfully, but the PROC PRINT step generates errors and stops processing. - correct answer ✅Correct answer: c The BY statement is required in PROC SORT 6.8 Which statement below selects rows that satisfy both these conditions?
c. where amount <= 5000 and (account='101-1092' or rate eq 0.095); d. where amount <= 5000 or account='101-1092' and rate = 0.095; - correct answer ✅Correct answer: c To ensure that the compound expression is evaluated correctly, you can use parentheses to group the observations: account='101-1092' or rate eq 0. 6.9 What does PROC PRINT display by default? a. PROC PRINT does not create a default report; you must specify the rows and columns to be displayed. b. PROC PRINT displays all observations and variables in the data set. If you want an additional column for observation numbers, you can request it. c. PROC PRINT displays columns in the following order: a column for observation numbers, all character variables, and all numeric variables. d. PROC PRINT displays all observations and variables in the data set, a column for observation numbers on the far left, and variables in the order in which they occur in the data set. - correct answer ✅Correct answer: d By default, PROC PRINT prints all observations and variables. 7.1 Which of the following is not written to the output during the compilation phase? a. the data set descriptor b. the first observation