## SAS Certified Base Programmer 123 Questions (123)

The following SAS program is submitted:

data test; set sasuser.employees; if 2 le years_service le 10 then amount=1000; else if years_service gt 10 then amount=2000; else amount=0; amount_per_year=years_serice/amount; run;

Which one of the following values does the variable AMOUNT_PER_YEAR contain if an employee has been with the company for one year?

A. 0

B. 1000

C. 2000

D. . (missing numeric value)

D

Please provide the questions along with the answers for base SAS

the 1st comment is the correct answer.

D is right. the output of running the program is:

years_ amount_ years_

Obs service amount per_year serice

1 1 0 . .

What does this if condition means

if 2 le years_service le 10 then

It is nice for SAS certifications.

D is correct answer.

any number divided by 0 is undefined. so i guess the answer is D

D is supposed to be the correct answer but there is a typo in the question amount_per_year=years_serice/amount;

“years_serice” r is missing in service

The correct answer is:

Numeric Missing Value, because

is impossiblie the division by 0.

Its an indefined number.

I share this code for test de true answer:

data probando;

infile datalines dsd;

input Years_service;

datalines;

1

2

3

4

5

6

7

8

9

10

11

12

45

;

run;

proc print data=probando;

run;

*NOW THE IMPORTANT CODE;

data prueba;

set work.probando;

if 2 le years_service le 10 then

amount=1000;

else if years_service gt 10 then

amount=2000;

else

amount=0;

amount_per_year=years_service/amount;

run;

proc print data=prueba;

run;

D is the correct answer . If you divide any value with 0 the final result will be .( missing value )

the correct answer is D.

thre is typo in the prog :

data test;

set sasuser.employees;

if 2 le years_service le 10 then

amount=1000;

else if years_service gt 10 then

amount=2000;

else

amount=0;

amount_per_year=years_service/amount;

run;

D is right.

D is the correct answer

Above condition satisfies the last else statement,

else

amount=0;

amount_per_year=years_serice/amount;

so amount_per_year=1/0;

Answer will be(.) which is missing value.

Answer D is correct.

D is the answer. Division by o returns a missing value