The error messages in the SAS log indicate issues with the treatment of text as a character string. In SAS, character strings must be enclosed in quotation marks. The log shows that 'ABC Inc.' is treated as if it is a variable or an expression, which is causing a syntax error. Enclosing 'ABC Inc.' in quotation marks will correctly identify it as a character string. Therefore, Option B is the correct action to resolve the error messages. This error is evident as the log indicates it was expecting an arithmetic operator, which suggests that the text was misinterpreted as part of an expression.
References:
SAS documentation on character strings and data step options, SAS Institute.
Question # 25
Which two statements are true about data set options such as KEEP= and RENAME =? (Choose two.)
Options:
A.
The options must be placed in parentheses.
B.
The options are not allowed in PROC steps.
C.
The options can be used only on the output data set.
Data set options in SAS, such as KEEP= (to specify variables to keep in a dataset) and RENAME= (to change the names of variables in a dataset), have specific rules for their usage:
A. The options must be placed in parentheses - This is correct. When specifying dataset options in SAS, they must be enclosed in parentheses immediately following the dataset name, without any spaces in between.
D. The options are placed after the data set name - This is also correct. Dataset options follow the dataset name and are enclosed in parentheses to modify how SAS reads or writes the dataset in that step.
Option B is incorrect because data set options are allowed in both DATA and PROC steps, provided they are relevant to the procedure being used. Option C is incorrect because data set options can be applied to both input and output datasets, depending on the context and specific operation being performed.
References: SAS 9.4 Language Reference: Concepts.
Question # 26
Given the following code:
Which variables are created with the BY statement?
In SAS, when you use a BY statement in a DATA step, SAS creates two temporary variables for each variable listed in the BY statement: one to indicate the first occurrence (FIRST.variable) and another to indicate the last occurrence (LAST.variable) of the value within the BY-group. Given the provided code and assuming that State is the variable used in the BY statement, SAS will create First.State and Last.State. Thus, option A is correct.
References:
SAS documentation on the BY statement, SAS Institute.