SAS Base (58)

The following program is submitted:

proc format;
value salfmt. 0 -< 50000 = ‘Less than 50K’ 50000 – high = ’50K or Greater’;

options fmterr nodate pageno=1;
title ‘Employee Report’;

proc print data=work.employees noobs;
var fullname salary hiredate;
format salary salfmt. hiredate date9.;
label fullname=’Name of Employee’ salary=’Annual Salary’ hiredate=’Date of Hire’;
run;

Why does the program fail?

A. The PAGENO option is invalid in the OPTIONS statement.
B. The RUN statement is missing after the FORMAT procedure.
C. The format name contains a period in the VALUE statement.
D. The LABEL option is missing from the PROC PRINT statement.

Check Answer
Answer: C

注解:When defining custom formats, the name of formats cannot end in a number or a period. The name, ‘salfmt.’, in VALUE statement is invalid. However, when you refer to the custom format, the ending period is necessary.