SAS Certified Base Programmer 50 Questions (19)
A raw data file is listed below.
1---+----10---+----20---+--- 1901 2 1905 1 1910 6 1925 1 1941 1
The following SAS program is submitted and references the raw data file above:
data money; infile 'file-specification'; input year quantity; total=total+quantity; run;
What is the value of total when the data step finishes executing
a. 0
b. 1
c. 11
d. . (missing numeric value)
Topics:
SAS Base Questions |
6 Comments »
D
Can you Explani how it is Missing value ??
Please explain the result with proper justification.
Thanks in advance.
how? I think its 11…
I’m guessing that it’s because sum statement is not in the below format where value of zero is automatically assigned to variable.
variable+expression
but it is an assignment statement instead.
variable = variable + expression
So the value of variable has not been defined and is missing. In this assignment statement, SAS assigns a missing value.
The variable total needs to be defined before any function is performed it. Missing Value+anything= missing value