Learning SAS? Welcome to the exclusive online community for all SAS learners.

base certification question

Reply
Contributor
Posts: 27

base certification question

Preparing for base certification.Tried this out is missing value...Does any number divided by 0 is assigned missing or any other concept behind this program???/

The following SAS program is submitted:

data test;

set sasuser.employees;

if 2 le years_service le 10 then

amount = 1000;

else amount = 0;

amount_per_year = years_service / amount

run;

What is the value of the variable AMOUNT_PER_YEAR if an employee has been with the company for one

year?

A. 0

B. 0.001

C. 1

D. . (missing numeric value)

Answer: D

Section: (none)

Super User
Posts: 11,343

Re: base certification question

Posted in reply to NoorulIyn

...Does any number divided by 0 is assigned missing or any other concept behind this program???/

Very easy to program and check.

If years_service was missing the result would be missing. If amount is missing the result would be missing. If Amount is 0 then the division is undefined and would be missing.

Ask a Question
Discussion stats
  • 1 reply
  • 310 views
  • 0 likes
  • 2 in conversation