By admin | July 27, 2009

SAS Certified Base Programmer 50 Questions (6)

Which action assigns a reference named SALES to a permanent SAS data library?

a. Issuing the command:
libref SALES 'SAS-data-library'

b. Issuing the command:
libname SALES 'SAS-data-library'

c. Submitting the statement:
libref SALES 'SAS-data-library';

d. Submitting the statement:
libname SALES 'SAS-data-library';

By admin | July 27, 2009

SAS Certified Base Programmer 50 Questions (5)

The following SAS program is submitted at the start of a new SAS session:

libname sasdata 'SAS-data-library';
data sasdata.sales;
    set sasdata.salesdata;
    profit=expenses-revenues;
run;

proc print data=sales;
run;

The SAS data set Sasdata.Salesdata has ten observations. Which one of the following explains why a report fails to generate?

a. The DATA step fails execution.
b. The SAS data set Sales does not exist.
c. The SAS data set Sales has no observations.
d. The PRINT procedure contains a syntax error.

By admin | July 27, 2009

SAS Certified Base Programmer 50 Questions (4)

A raw data file is listed below.

1---+----10---+----20---+----30---+----40---+----50
TWOSTORY 1040 2      1SANDERS ROAD      $55,850
CONDO    2150 4    2.5JEANS AVENUE     $127,150

The following program is submitted using this file as input:

data work.houses;
    infile 'file-specification';
    <insert INPUT statement here>
run;

Which one of the following INPUT statements reads the raw data file correctly?

a. 
input @1  style $8.
+1  sqfeet 4.
+1  bedrooms 1.
@20 baths 3.
    street 16.
@40 price dollar8;
b. 
input @1  style $8
+1  sqfeet 4.
+1  bedrooms 1.
@20 baths 3.
    street $16.
@40 price dollar8.;
c. 
input @1  style $8.
+1  sqfeet 4.
+1  bedrooms 1.
@20 baths 3.
    street $16.
@40 price dollar8.;
d. 
input @1  style $8.
+1  sqfeet 4.
+1  bedrooms 1.
@20 baths 3
    street 16.
@40 price dollar8.;
By admin | July 27, 2009

SAS Certified Base Programmer 50 Questions (3)

The following program is submitted:

data numrecords;
    infile cards dlm=',';
    input agent1 $ agent2 $ agent3 $;
cards;
jones,,brownjones,spencer,brown
;
run;

What is the value for the variable named Agent2 in the second observation?

a. brown
b. spencer
c. ”(missing character value)
d. There is no value because only one observation is created

By admin | July 27, 2009

SAS Certified Base Programmer 50 Questions (2)

A raw data file is listed below.

1---+----10---+----20---+
Jose,47,210
Sue,,108

The following program is submitted using the raw data file above as input:

data employeestats;
    <insert INFILE statement here>
    input name $ age weight;
run;

The following output is desired:

name age weight
Jose  47  210
Sue   .   108

Which of the following INFILE statement completes the program and accesses the data correctly?

a. infile ‘file-specification’ pad;
b. infile ‘file-specification’ dsd;
c. infile ‘file-specification’ dlm=’,’;
d. infile ‘file-specification’ missover;