If date = ‘01012000’d then event = ‘January 1st’ The contents of the raw data file CALENDAR are listed below:.An incomplete output data set is created due to syntax errors. PRODUCT, SALES, MONTH, NUM_SOLD and COST onlyĭ. Which variables does the WORK.JANUARY data set contain?ī. If month = ‘Jan’ then output work.january Set work.allmonths (keep = product month num_sold cost) The program runs without errors or warnings and creates the WORK.TOTALSALES data set with 60 observations. The program runs with warnings and creates the WORK.TOTALSALES data set with 60 observations.ĭ. Set work.monthlysales(keep = year product sales) Ĭ. The program executes without errors or warnings and creates the WORK.TOTALSALES data set. The program executes with warnings and creates the WORK.TOTALSALES data set.ĭ. The program fails execution due to syntax errors.Ĭ. The program fails execution due to data errors.ī.
Which one of the following is the result of the above program?Ī. The data set named WORK.MONTHLYSALES has one observation per month for each of five years for a total of 60 observations. Set work.monthlysales (keep = year product sales) The DATA step stops executing at the point of the error, and the resulting DATA set contains observations up to that point.ĭata work.totalsales (keep = monthsales ) A note appears in the SAS log that the incorrect data record was saved to a separate SAS file for further examination.ĭ. A note is written to the SAS log explaining the error, and the DATA step continues to execute.Ĭ. The DATA step stops executing at the point of the error, and no SAS data set is created.ī. Which one of the following is true when SAS encounters a data error in a DATA step?Ī.The _ERROR_ variable can be used in expressions or calculations in the DATA step. The _ERROR_ variable is automatically stored in the resulting SAS data set.ĭ. The _ERROR_ variable contains the values ‘TRUE’ or ‘FALSE’.Ĭ. The _ERROR_ variable contains the values ‘ON’ or ‘OFF’.ī. Which one of the following statements is true regarding the SAS automatic _ERROR_ variable?Ī.Which one of the following is the value of the SALARY variable? Which one of the following is the value of the NUMBER variable? The contents of the raw data file NAMENUM are listed below:.The value can not be determined as the program fails to execute due to errors. Which one of the following is the value of the DESCRIPTION variable?ĭ. If _error_ then description = ‘Problems’ The contents of the raw data file AMOUNT are listed below:.Which one of the following values does the variable AMOUNT_PER_YEAR contain if an employee has been with the company for The following SAS program is submitted:Īmount_per_year = years_service / amount.If you do not want missing values to be treated as “false,” then do not reference a variable directly, but instead use a Boolean expression in the IF-THEN statement.įor example, in the following statement a missing value results in the THEN statement being executed, whereas all other numerical values continue to behave as expected. More correctly, here is an excerpt from the SAS documentation: SAS evaluates the expression in an IF-THEN statement to produce a result that is either non-zero, zero, or missing.Ī non-zero and nonmissing result causes the expression to be true a result of zero or missing causes the expression to be false. This brings up the question: What happens if SAS encounters a missing value in an IF-THEN expression? Does the IF-THEN expression treat the missing value as “true” and execute the THEN statement, or does it treat the missing value as “false” and execute the alternative ELSE statement (if it exists)? data A Īh-ha! SAS interprets a missing value as “false.”Īnd also check the result for the below program: data A Īh-ha! SAS interprets a missing value as “true.” One of the interesting features of the SAS language is that it is designed to handle missing values. The basic syntax is if numeric-expression then In SAS, the IF-THEN (or IF-THEN/ELSE) statement evaluates an expression and braches according to whether the expression is nonzero (true) or zero (false). Every programming language has an IF-THEN statement that branches according to whether a Boolean expression is true or false.