- Based on this program and the observation shown in the PDV, what variable's value will be assigned to Amount?
data payroll;
set salaries;
if PayClass='Monthly' then Amount=Salary;
else if PayClass='Hourly' then do;
Amount=HrlyWage*Hrs;
if Hrs>40 then Msg='CHECK TIMECARD';
end;
else Amount=JobRate;
run;
PDV
EmpID |
PayClass |
Hrs |
Amount |
JobRate |
Msg |
1201 |
Contract |
30 |
. |
. |
|
- Which of the following SAS functions returns a number from 1 to 12?
- The data set orion.sales contains nine variables. Given this DATA step, how many variables does the descriptor portion of work.comp contain?
date work.comp;
set orion.sales;
drop Gender Salary Country;
Compensation=sum(Salary,Bonus);
run;
- Which DATA step ensures that all observations are assigned a nonmissing value for Bonus?
- In the DATA step below, what is the length of the new variable, Type?
data orion.newloan;
set orion.records;
TotalPaid=sum(TotLoan+Interest);
if Code='1' then Type='Fixed';
else Type='Variable';
length Type $ 10;
run;
- In the program below, what is the value of Benefit for the observation shown?
data work.total;
set payroll.june;
Benefit=sum(Ins,Health_Award);
run;
PDV
EmpID |
Salary
|
Ins
|
Bonus
|
Health_Award |
Benefit |
KBA |
54000 |
800 |
250 |
. |
. |
- Which of these statements does not correctly specify a SAS function?
- Given what you know about how SAS processes the DROP and KEEP statements, would these two DATA steps create the same data set?
data work.subset1;
set orion.sales;
drop Salary;
Bonus=500;
Compensation=sum(Salary,Bonus);
BonusMonth=month(Hire_Date);
run; |
data work.subset1;
set orion.sales;
Bonus=500;
Compensation=sum(Salary,Bonus);
BonusMonth=month(Hire_Date);
drop Salary;
run; |
- Which of the following determines the length of a new variable at compile time?
- Use a DO group in a DATA step when you want to execute multiple statements for a true IF-THEN expression.
|