By admin | November 25, 2009

SAS Certified Adv Programmer 130 Questions (23)

The SAS data set ONE consists of five million observations and has 25 variables.

Which one of the following SAS programs successfully creates three new variables TOTREV, TOTCOST, and PROFIT and requires the least CPU time to be processed?

A.

data two;
    set one;
    totrev sum(price * quantity);
    totcost = sum(fixed,variable);
    profit = sum(totrev,totcost); 
    if totrev> 1000; 
run;

B.

data two;
    set one;
    totrev = sum(price * quantity);
    if totrev> 1000;
        totcost = sum(fixed,variable);
    profit = sum(totrev,totcost); 
run;

C.

data two;
    set one; 
    totrev = sum(price * quantity);
    where totrev> 1000;
    totcost = sum(fixed,variable);
    profit = sum(totrev,totcost);
run;

D.

data two;
    set one; where totrev> 1000;
    totrev = sum(price * quantity);
    totcost = sum(fixed,variable);
    profit = sum(totrev,totcost);
run; 

By admin | November 25, 2009

SAS Certified Adv Programmer 130 Questions (22)

Given the following SAS data set ONE:

ONE 
GROUP SUM
A     765
B     123
C     564

The following SAS program is submitted:

data _null_;
    set one; 
    call symput(group,sum);
run;

Which one of the following is the result when the program finishes execution?

A. Macro variable C has a value of 564.
B. Macro variable C has a value of 1452.
C. Macro variable GROUP has a value of 564.
D. Macro variable GROUP has a value of 1452.

By admin | November 25, 2009

SAS Certified Adv Programmer 130 Questions (21)

The following SAS program is submitted:

%let lib = %upcase(sasuser);
proc sql;
    select nvar from dictionary.tables
        where libname = "&lib";
quit;

Given that several SAS data sets exist in the SASUSER library, which one of the following is generated as output?

A. no result set
B. a syntax error in the log
C. a report showing the names of each table in SASUSER
D. a report showing the number of columns in each table in SASUSER

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

By admin | November 18, 2009

SAS Certified Adv Programmer 130 Questions (19)

The SAS data set TEMP has the following distribution of values for variable A:

A Frequency
1 500,000
2 500,000
6 7,000,000
8 3,000

Which one of the following SAS programs requires the least CPU time to be processed?

A.

data new; 
    set temp;
    if a = 8 then
        b = ‘Small’;
    else if a in(1, 2) then
        b = ‘Medium’;
    else if a = 6 then
        b = ‘Large’;
run;

B.

data new;
    set temp;
    if a in (1, 2) then
        b = ‘Medium’;
    else if a= 8 then
        b = ‘Small’;
    else if a = 6 then
        b = ‘Large’;
run;

C.

data new;
    set temp;
    if a = 6 then 
        b = ‘Large’;
    else if a in (1, 2) then
        b = ‘Medium’;
    else if a=8 then
        b = ‘Small’;
run;

D.

data new;
    set temp;
    if a = 6 then
        b = ‘Large’;
    if a in(1, 2) then
        b = ‘Small’;
run; 

Pages: Prev 1 2 ... 5 6 7 8 9 ... 55 56 Next