By admin | November 18, 2009

SAS Certified Adv Programmer 130 Questions (20)

The following SAS program is submitted:

%let value = 9;
%let value2 = 5;
%let newval =
%eval(&value / &value2);

Which one of the following is the resulting value of the macro variable NEWVAL?

A. 1
B. 2
C. 1.8
D. null

4 comments | Add One

  1. admin - 11/18/2009 at 12:15 pm

    A

  2. Consty - 02/19/2013 at 3:05 pm

    A: the result of the division is rounded to an integer value

  3. TTT - 07/4/2013 at 1:02 am

    9/5 = 1.8

    but eval must make integer.

    so is it round down?

  4. Dave - 03/26/2014 at 1:40 pm

    I’m not sure that’s correct. I looked this up on the SAS website, which says, “If a division operation results in a fraction, the fraction is truncated to an integer.” Specifically for this example, 9/5 = 1.8, so it’s truncaded to 1, not rounded to 2.

Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *