Independence Day Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: netdisc

SAS Institute A00-211 SAS Base Programming for SAS (r) 9 Exam Practice Test

Demo: 40 questions
Total 270 questions

SAS Base Programming for SAS (r) 9 Questions and Answers

Question 1

The following SAS program is submitted:

data work.total;

set work.salary(keep = department wagerate);

by department;

if first.department

then payroll = 0;

payroll + wagerate;

if last.department

run;

The SAS data set WORK.SALARY, currently ordered by DEPARTMENT, contains 100 observations for each of 5 departments.

What is the result?

Options:

A.

The WORK.TOTAL data set contains 5 observations.

B.

The WORKTDTAL data set contains 100 observations.

C.

The WORKTOTAL data set contains 500 observations.

D.

The program fails to execute due to errors.

Question 2

Given the following code:

proc print data=SASHELP.CLASS(firstobs=5 obs=15);

where Sex='M';

run;

How many observations will be displayed?

Options:

A.

11

B.

15

C.

10 or fewer

D.

11 or fewer

Question 3

Given the SAS data set EMPLOYEES:

EMPLOYEES

NAME SALARY

-------- ------------

Innis60000

Jolli50000

Ellis55000

Liu45000

The following SAS program is submitted:

proc print data = employees; where name like ‘_i%’;

run;

What is contained in the output?

Options:

A.

Liu only

B.

Innis and Ellis only

C.

Innis, Ellis, and Liu only

D.

Innis, Jolli, Ellis, and Liu

Question 4

The following SAS program is submitted:

How will the Exam variable value be displayed in the FREQ procedure output?

Options:

A.

Fail

B.

Pass

C.

50.5

D.

. (missing numeric value)

Question 5

The Excel workbook QTR1.XLS contains the following three worksheets:

JAN

FEB

MAR

Which statement correctly assigns a library reference to the Excel workbook?

Options:

A.

libname qtrdata 'qtr1.xls';

B.

libname 'qtr1.xls' sheets=3;

C.

libname jan feb mar 'qtr1.xls';

D.

libname mydata 'qtr1.xls' WORK.heets=(jan,feb,mar);

Question 6

Given the raw data file YEARAMT:

----|---10---|---20---|----30

1901 2

1905 1

1910 6

1925 .

1941 1

The following SAS program is submitted:

data coins;

infile ‘yearamt’;

input year quantity;

run;

Which statement(s) completed the program and produced a non-missing value for the variable

TOTQUANTITY in the final observation of the output data set?

Options:

A.

totquantity + quantity;

B.

totquantity = sum(totquantity + quantity);

C.

retain totquantity; totquantity = totquantity + quantity;

D.

retain totquantity0; totquantity = totquantity + quantity;

Question 7

Given the SAS data set ONE:

ONE

ObsDte

-------------

109JAN2005

212JAN2005

The following SAS program is submitted:

data two;

set one;

day = ;

format dte date9.;

run;

The data set TWO is created:

TWO

ObsDteDay

109JAN20051

12JAN20054

Which expression successfully completed the program and created the variable DAY?

Options:

A.

day(dte)

B.

weekday(dte)

C.

dayofweek(dte)

D.

datdif(dte,’01jan2005’d,’act/act’)

Question 8

The following SAS program is submitted:

The program fails execution due to syntax errors. What is the cause of the syntax error?

Options:

A.

The variable MONTHSALES does not exist.

B.

An array cannot be referenced on a KEEP data set option.

C.

The KEEP= data set option should be (KEEP = MONTHSALES).

D.

The KEEP= data set option should be the statement KEEP MONTHSALES{12}.

Question 9

After a SAS program is submitted, the following is written to the SAS log:

105 data january;

106 set allmonths(keep = product month num_sold cost);

107 if month = ‘Jan’ then output january;

108 sales = cost * num_sold;

109 keep = product sales;

------

22

ERROR 22-322: Syntax error, expecting one of the following:!,

!!, &, *,**, +, -,/, <,< =, <>, =, >, ><, >=,

AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL,

NOTIN, OR,^=,|,II,

110 run;

What changes should be made to the KEEP statement to correct the errors in the LOG?

Options:

A.

keep product sales;

B.

keep product, sales;

C.

keep = product, sales;

D.

keep = (product sales);

Question 10

The value 110700 is stored in a numeric variable named SALARY.

Which FORMAT statement displays the value as $110,700.00 in a report?

Options:

A.

format salary comma11.2;

B.

format salary dollar8.2;

C.

format salary dollar11.2;

D.

format salary comma8.2 dollar8.2;

Question 11

The following SAS program is submitted:

data work.passengers;

if OrigPassengers = . then'

OrigPassengers = 100;

TransPassengers = 100;

OrigPassengers = .;

TotalPassengers = sum (OrigPassengers, TransPassengers) +0;

run;

What is the value of the TOTALPASSENGERS variable in the output data set?

Options:

A.

0

B.

100

C.

200

D.

(missing numeric value)

Question 12

The following SAS program is submitted:

data one;

date = ‘04juI2005’d;

format date weekdate.; run;

proc print data = one; run;

What output is generated?

Options:

A.

Obs date1 Monday, July 4, 2005

B.

Obs date1 July4, 2005

C.

Obs date1 04Jul2005

D.

Obs date1 Monday, 07/04/2005

Question 13

Given the SAS data set PERM.STUDENTS:

PERM.STUDENTS NAMEAGE

---------------- Alfred14

Alice13

Barbara13

Carol14

The following SAS program is submitted:

libname perm ‘SAS data library’;

data students;

set perm.students;

file ‘file specification’;

put name $ age;

run;

The following double-spaced file is desired as output

Alfred 14

Alice 13

Barbara 13

Carol 14

Which statement completes the program and creates the desired file?

Options:

A.

put

B.

put/;

C.

double;

D.

put _null_;

Question 14

What is the purpose or the MISSOVER option on the INFILE statement?

Options:

A.

It prevents SAS from loading a new record when the end of the current record is reached.

B.

It enables SAS to scan the input data records until the character string that is specified in the @‘character-string’ expression is round.

C.

It enables SAS to continue to read the next input data record if it does not find values in the current input tine for all the variables in the statement.

D.

It causes the DATA step to stop processing if an INPUT statement reaches the end of the current record without finding values for all variables in the statement.

Question 15

The following SAS program is submitted;

data combine;

country = ‘Italy, Russia, ireland’;

found = find(country, ‘i’);

run;

What is the value of the variable FOUND in the output data set?

Options:

A.

1

B.

12

C.

Italy

D.

Russia

Question 16

The SAS data set PETS is sorted by the variables TYPE and BREED.

The following SAS program is submitted:

proc print data = pets;

var type breed;

sum number;

run;

What is the result?

Options:

A.

The SUM statement produces only a grand total of NUMBER.

B.

The SUM statement produces only subtotals of NUMBER for each value of TYPE.

C.

The SUM statement produces both a grand total of NUMBER and subtotals of NUMBER for each value of TYPE.

D.

Nothing is produced by the SUM statement; the program fails to execute.

Question 17

The following SAS program is submitted:

data temp.x;

set sasuser.y;

run;

What must be submitted prior to this SAS program for the program to execute successfully?

Options:

A.

A LIBNAME statement for the libref TEMP only must be submitted.

B.

A LIBNAME statement for the libref SASUSER only must be submitted.

C.

LIBNAME statements for the librefs TEMP and SASUSER must be submitted.

D.

No LIBNAME statement needs to be submitted.

Question 18

Which statement is true concerning the SAS automatic variable _ERROR_?

Options:

A.

It cannot be used in an if/then condition.

B.

It cannot be used in an assignment statement.

C.

It can be put into a keep statement or keep= option.

D.

It is automatically dropped.

Question 19

Given the data set WORK.EMPDATA:

Which one of the following where statements would display observations with job titles containing the word 'Manager'?

Options:

A.

where substr(Job_Title,(length(Job_Title)-6))='Manager';

B.

where upcase(scan(Job_Title,-1,' '))='MANAGER';

C.

where Job_Title='% Manager ';

D.

where Job_Title like '%Manager%';

Question 20

Read the table:

Given the SAS data set SASUSER.HOUSES:

Obsstylebedroomsbathspricesqteetstreet

1CONDO21.5800501200MAIN

2CONDO32.5793501300ELM

3CONDO42.51271501400OAK

4CONDO22.01107001100FIFTH

5TWOSTORY43.01072502100SECOND

6TWOSTORY21.0556501600WEST

7TWOSTORY21.0692501450NORTH

6TWOSTORY42.5102950 2000SOUTH

The following SAS program is submitted:

proc report data = sasuser.houses nowd headline;

column style price;

where price It 100000;

define price / mean width = 9 format = dollar12.;

title;

run;

The following output is desired:

styleprice

-------------

CONDO$79,700

TWOSTORY$62550

Which DEFINE statement completes the program and produces the desired output?

Options:

A.

define style / width = 9,

B.

define style / orderwidth = 9;

C.

define style / group width = 9;

D.

define style / display width = 9;

Question 21

The following SAS program is submitted:

What is the value of the second variable in the data set WORK.AUTHORS?

Options:

A.

Hemingway

B.

Hemingwa

C.

' ' (a missing value)

D.

The program contains errors. No variables are created.

Question 22

The following SAS program is submitted:

data work.totalsales;

set work.monthlysales(keep = year product sales);

retain monthsales {12} ;

array monthsales {12} ;

do i = 1 to 12;

monthsales{i} = sales;

end;

cnt + 1;

monthsales{cnt} = sales;

run;

The data set named WORK.MONTHLYSALES has one observation per month for each of five years for a total of 60 observations.

Which one of the following is the result of the above program?

Options:

A.

The program fails execution due to data errors.

B.

The program fails execution due to syntax errors.

C.

The program runs with warnings and creates the WORK.TOTALSALES data set with 60 observations.

D.

The program runs without errors or warnings and creates the WORK.TOTALSALES data set with 60 observations

Question 23

Given the SAS data set WORK.THREE:

The following SAS program is submitted:

What is the result?

Options:

A.

B.

C.

D.

Question 24

Consider the following data step:

data WORK.NEW;

set WORK.OLD;

Count+1;

run;

The varaible Count is created using a sum statement. Which statement regarding this variable is true?

Options:

A.

It is assigned a value 0 when the data step begins execution.

B.

It is assigned a value of missing when the data step begins execution.

C.

It is assigned a value 0 at compile time.

D.

It is assigned a value of missing at compile time.

Question 25

The following SAS program is submitted:

data work.staff;

JobCategory = 'FA';

JobLevel = '1';

JobCategory = JobCategory || JobLevel;

run;

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

Options:

A.

FA

B.

FA1

C.

FA 1

D.

' ' (missing character value)

Question 26

Given the raw data file ‘DEPENDENTS.TXT’:

The following SAS program is submitted:

What will be the value of _ERROR_ in the Program Data Vector for each iteration of the DATA step?

Options:

A.

B.

C.

D.

Question 27

Consider the following data step:

In filtering the values of the variable X in data set WORK.OLD, what value new value would be assigned to X if its original value was a missing value?

Options:

A.

X would get a value of 1.

B.

X would get a value of 3.

C.

X would retain its original value of missing.

D.

This step does not run because of syntax errors.

Question 28

The following SAS program is submitted:

data _null_;

set old (keep = prod sales1 sales2);

file 'file-specification';

put sales1 sales2;

run;

Which one of the following default delimiters separates the fields in the raw data file created?

Options:

A.

: (colon)

B.

(space)

C.

, (comma)

D.

; (semicolon)

Question 29

How many of the following SAS data set names are valid?

Options:

A.

4

B.

3

C.

1

D.

2

Question 30

The SAS data set WORK.AWARDS is listed below:

fname points

Amy 2

Amy 1

Gerard 3

Wang 3

Wang 1

Wang 2

The following SAS program is submitted:

proc sort data = work.awards;

by descending fname points;

run;

Which one of the following represents how the observations are sorted?

Options:

A.

Wang 3Gerard 3Wang 2Amy 2Wang 1Amy 1

B.

Wang 3Wang 2Wang 1Gerard 3Amy 2Amy 1

C.

Wang 3Wang 1Wang 2Gerard 3Amy 2Amy 1

D.

Wang 1Wang 2Wang 3Gerard 3Amy 1Amy 2

Question 31

Given the SAS data set WORK.PRODUCTS:

How many observations does the WORK.OUTDOOR data set contain?

Options:

A.

1

B.

2

C.

3

D.

6

Question 32

The following SAS program is submitted:

data WORK.PRODUCTS;

Prod=1;

do while (Prod LE 7);

Prod + 1;

end;

run;

What is the value of the variable Prod in the output data set?

Options:

A.

7

B.

8

C.

6

D.

.(missing numeric)

Question 33

The contents of the raw data file TEAM are listed below:

--------10-------20-------30

Janice 10

Henri 11

Michael 11

Susan 12

The following SAS program is submitted:

data group;

infile 'team';

input name $15. age 2.;

file 'file-specification';

put name $15. +5 age 2.;

run;

Which one of the following describes the output created?

Options:

A.

a raw data file only

B.

a SAS data set named GROUP only

C.

a SAS data set named GROUP and a raw data file

D.

No output is generated as the program fails to execute due to errors.

Question 34

The following SAS program is submitted:

data work.test;

Author = 'Christie, Agatha';

First = substr(scan(author,2,' ,'),1,1);

run;

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

Options:

A.

A

B.

C

C.

Agatha

D.

' ' (missing character value)

Question 35

The following SAS DATA step is submitted:

data work.accounting;

set work.department;

length jobcode $ 12;

run;

The WORK.DEPARTMENT SAS data set contains a character variable named JOBCODE with a length of 5. Which one of the following is the length of the variable JOBCODE in the output data set?

Options:

A.

5

B.

8

C.

12

D.

The length can not be determined as the program fails to execute due to errors.

Question 36

You're attempting to read a raw data file and you see the following messages displayed in the SAS Log:

What does it mean?

Options:

A.

A compiler error, triggered by an invalid character for the variable Salary.

B.

An execution error, triggered by an invalid character for the variable Salary.

C.

The 1st of potentially many errors, this one occurring on the 4th observation.

D.

An error on the INPUT statement specification for reading the variable Salary.

Question 37

The SAS data set BANKS is listed below:

BANKS

name rate

FirstCapital 0.0718

DirectBank 0.0721

VirtualDirect 0.0728

The following SAS program is submitted:

data newbank;

do year = 1 to 3;

set banks;

capital + 5000;

end;

run;

Which one of the following represents how many observations and variables will exist in the SAS data set NEWBANK?

Options:

A.

0 observations and 0 variables

B.

1 observations and 4 variables

C.

3 observations and 3 variables

D.

9 observations and 2 variables

Question 38

Population is currently at 34,278,400 for country A and is expected to rise at a rate of 2%.

Which DO LOOP will correctly calculate growth rate over the next 10 years beginning in 2012 as shown in the graphic below?

Options:

A.

B.

C.

D.

Question 39

The following SAS program is submitted:

data allobs;

set sasdata.origin (firstobs = 75 obs = 499);

run;

The SAS data set SASDATA.ORIGIN contains 1000 observations.

How many observations does the ALLOBS data set contain?

Options:

A.

424

B.

425

C.

499

D.

1000

Question 40

The SAS data sets WORK.EMPLOYEE and WORK.SALARY are listed below:

WORK.EMPLOYEE WORK.SALARY

fname age fname salary

Bruce 30 Bruce 25000

Dan 40 Bruce 35000

Dan 25000

The following SAS program is submitted:

data work.empdata;

merge work.employee

work.salary;

by fname;

totsal + salary;

run;

How many variables are output to the WORK.EMPDATA data set?

Options:

A.

3

B.

4

C.

5

D.

No variables are output to the data set as the program fails to execute due to errors

Demo: 40 questions
Total 270 questions