Question 6 of 270

Given the raw data record DEPT:
----|----10---|----20---|----30

Printing 750 -
The following SAS program is submitted:
data bonus;
infile dept;
inputdept$ 1-11 number 13- 15;
<insert statement here>
run;
Which SAS statement completes the program and results in a value of Printing750 for the DEPARTMENT variable?
Answer

Suggested Answer

The suggested answer is D.

Community Votes

No votes yet

Join the discussion to cast yours

Question 7 of 270

The following SAS program is submitted:
data one;
addressl = 214 London Way;
run;
data one;
set one;
address = tranwrd(address1, Way, Drive); run;
What are the length and value of the variable ADDRESS?
Answer

Suggested Answer

The suggested answer is D.

The length of the new variable created by the tranwrd function is automatically set to 200 bytes if the length is not previously defined. Therefore, the length is 200. Additionally, the value of the variable 'address' after the substitution in the tranwrd function will be '214 London Drive'.

Community Votes

No votes yet

Join the discussion to cast yours

Question 8 of 270

The following SAS program is submitted:
data work.sets;
do until (prod gt 6);
prod + 1;
end;
run;
What is the value of the variable PROD in the output data set?
Answer

Suggested Answer

The suggested answer is B.

In the provided SAS program, a DO UNTIL loop is used, which will continue executing until the condition (prod > 6) is met. Initially, the variable PROD is implicitly set to 0. The loop increments PROD by 1 in each iteration. The loop will execute as long as PROD is less than or equal to 6. The looping stops when PROD becomes 7 after it is incremented from 6. Hence, the final value of the variable PROD in the output data set is 7.

Community Votes

No votes yet

Join the discussion to cast yours

Question 9 of 270

The SAS data sets WORK.EMPLOYEE and WORK.SALARY are shown below:

WORK.EMPLOYEE WORK.SALARY -
fname age name salary

Bruce 30 Bruce 25000 -

Dan 40 Bruce 35000 -

Dan 25000 -
The following SAS program is submitted:
data work.empdata;
by fname;
totsal + salary;
run;
Which one of the following statements completes the merge of the two data sets by the FNAME variable?
Answer

Suggested Answer

The suggested answer is C.

To complete the merge of the two datasets by the FNAME variable, you need to account for the different names of the key variable in each dataset. In the WORK.EMPLOYEE dataset, the key variable is FNAME, while in the WORK.SALARY dataset, it is NAME. Thus, you should use the RENAME= data set option to standardize the key variable name before performing the merge. The correct syntax for this is 'merge work.employee work.salary (rename = (name = fname));'. This way, the NAME variable in WORK.SALARY is renamed to FNAME, allowing the datasets to be merged by the FNAME variable.

Community Votes

No votes yet

Join the discussion to cast yours

Question 10 of 270

Which program displays a listing of all data sets in the SASUSER library?
Answer

Suggested Answer

The suggested answer is D.

Community Votes

No votes yet

Join the discussion to cast yours