The following SAS program is submitted:
proc sort data = work.employee;
by descending fname;
proc sort data = work.salary;
by descending fname;
data work.empdata;
merge work.employee
work.salary;
by fname;
run;
Why does the program rail to execute?
A. The SORT procedures contain invalid syntax.
B. The merged data sets are not permanent SAS data sets.
C. The RUN statement was omitted alter each or the SORT procedures.
D. The data sets were not merged in the order by which they were sorted.
The following SAS program is submitted:
libname temp `SAS data library';
data work.new;
set temp.jobs;
format newdate mmddw10.;
mdate = month(newdate);
ddate = weekday(newdate);
run;
proc print data = work.new; run;
The variable NEWDATE contains the SAS date value for April 15. 2005.
What output is produced if April 15, 2005 falls on a Friday?
A. Obsnewdate mdate ddate 104/15/2005 APR 6
B. Obs newdate mdate ddate 104/15/2005 4 6
C. Obs newdate mdate ddate 104/15/2005 APR 7
D. Obs newdate mdate ddate 104/15/2005 4 7
Given the AIRPLANES data set
AlRPLANES TYPE MPG
F-18 105 C-130 25 Harrier 75 A-6 110
The following SAS program is submitted:
data gt100;
set airplanes(keep = type mpg load);
load = mpg * 150;
run;
The program fails to execute due to syntax errors.
What is the cause of the syntax error?
A. MPG is not a numeric variable.
B. LOAD is not a variable in the data set GT100.
C. LOAD is not variable in the data set AIRPLANES.
D. LOAD must be defined prior to the SET statement.
Which statement correctly computes the average of four numerical values?
A. average = mean(num1, num4);
B. average = mean(num1 - num4);
C. average = mean(ofnum1 - num4)
D. average = mean(num1 num2 num3 num4);
The following SAS program is submitted:
data WORK.ACCOUNTING;
set WORK.DEPARTMENT;
length EmpId $6;
CharEmpid=EmpId;
run;
If data set WORK.DEPARTMENT has a numeric variable EmpId. Which statement is true about the output
dataset?
A. The type of the variable CharEmpid is numeric.
B. The type of the variable CharEmpid is unknown.
C. The type of the variable CharEmpid is character.
D. The program fails to execute due to errors.
A SAS program is submitted and the following SAS log is produced:
2 data gt100;
3 set ia.airplanes
4 if mpg gt 100 then output;
22 202
ERROR: File WORK.IF.DATA does not exist.
ERROR: File WORK.MPG.DATA does not exist.
ERROR: File WORK.GT.DATA does not exist.
ERROR: File WORK.THEN.DATA does not exist.
ERROR: File WORK.OUTPUT.DATA does not exist.
ERROR 22-322: Syntax error, expecting one of the following: a name,
a quoted string, (, ;, END, KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
5 run;
The IA libref was previously assigned in this SAS session.
Which one of the following corrects the errors in the LOG?
A. Delete the word THEN on the IF statement.
B. Add a semicolon at the end of the SET statement.
C. Place quotes around the value on the IF statement.
D. Add an END statement to conclude the IF statement
The following SAS program is submitted:
data stats;
set revenue;
array weekly{5} mon tue wed thu fri;
total = weekly{i} * .25;
output;
end;
run;
Which one of the following DO statements completes the program and processes the elements of the
WEEKLY array?
A. do i = 1 to 5;
B. do weekly{i} = 1 to 5;
C. do i = mon tue wed thu fri;
D. A DO loop cannot be used because the variables referenced do not end in a digit.
The following SAS DATA step executes on Monday, April 25, 2000:
data newstaff;
set staff;
start_date = today();
run;
Which one of the following is the value of the variable START_DATE in the output data set?
A. a character string with the value '04/25/2000'
B. a character string with the value 'Monday, April 25, 2000'
C. the numeric value 14725, representing the SAS date for April 25, 2000
D. the numeric value 04252000, representing the SAS date for April 25, 2000
After a SAS program is submitted, the following is written to the SAS log:
What changes should be made to the KEEP statement to correct the errors in the LOG?
A. keep=(Product Sales);
B. keep Product, Sales;
C. keep=Product, Sales;
D. keep Product Sales;
There are 451 observations in the data set WORK.STAFF. The following SAS program is submitted:
What will be the value of NewVar when SAS writes the last observation?
A. 451
B. 1
C. 0
D. . (a missing value)