By admin | August 6, 2009

SAS Certified Base Programmer 50 Questions (21)

The following SAS program is submitted:

data work.AreaCodes;
    Phonenumber=3125551212;
    Code='('!!substr(Phonenumber,1,3)!!')';
run;

Which one of the following is the value of the variable Code in the output data set?

a. (  3)
b. (312)
c. 3
d. 312

By admin | August 5, 2009

SAS Certified Base Programmer 50 Questions (20)

The following program is submitted:

data test;
    average=mean(6,4,.,2);
run;

What is the value of average?

a. 0
b. 3
c. 4
d. . (missing numeric value)

By admin | August 5, 2009

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)

By admin | August 5, 2009

SAS Certified Base Programmer 50 Questions (18)

A raw data file is listed below.

1---+----10---+----20---+---
10
23
20
15

The following program is submitted:

data all_sales;
    infile 'file-specification';
    input receipts;
    <insert statement(s) here>
run;

Which statement(s) complete(s) the program and produce(s) a running total of the Receipts variable?

a.

total+receipts;

b.

total 0;
sum total;

c.

total=total+receipts;

d.

total=sum(total,receipts);

By admin | August 5, 2009

SAS Certified Base Programmer 50 Questions (17)

The following SAS program is submitted:

data fltaten;
    input jobcode $ salary name $;
cards;
FLAT1 70000 Bob
FLAT2 60000 Joe
FLAT3 30000 Ann
;
run;
data desc;
    set fltaten;
    if salary>60000 then description='Over 60';
    else description='Under 60';
run;

What is value of the variable named description when the value for salary is 30000?

a. Under 6
b. Under 60
c. Over 60
d. ” (missing character value)