New Year Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70percent

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:

What 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 2

The following SAS program is submitted:

data WORK.AUTHORS;

array Favorites{3} $ 8 ('Shakespeare','Hemingway','McCaffrey');

run;

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

Options:

A.

Hemingway

B.

Hemingwa

C.

' ' (a missing value)

D.

The program contains errors. No variables are created.

Question 3

Given the contents of the raw data file 'EMPLOYEE.TXT'

Which SAS informat correctly completes the program?

Options:

A.

date9

B.

mmddyy10

C.

ddmmyy10

D.

mondayyr10

Question 4

Given the following SAS data set WORK.SALES:

The following SAS program is submitted:

Which output is produced?

Options:

A.

B.

C.

D.

Question 5

A SAS program is submitted and the following SAS log is produced:

2 data gt100;

3 set ia.airplanes

4 if mpg gt 100 then output;

22 202

ERROR: File WORK.IF.DATA does not exist.

ERROR: File WORK.MPG.DATA does not exist.

ERROR: File WORK.GT.DATA does not exist.

ERROR: File WORK.THEN.DATA does not exist.

ERROR: File WORK.OUTPUT.DATA does not exist.

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

a quoted string, (, ;, END, KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.

ERROR 202-322: The option or parameter is not recognized and will be ignored.

5 run;

The IA libref was previously assigned in this SAS session.

Which one of the following corrects the errors in the LOG?

Options:

A.

Delete the word THEN on the IF statement.

B.

Add a semicolon at the end of the SET statement.

C.

Place quotes around the value on the IF statement.

D.

Add an END statement to conclude the IF statement

Question 6

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 7

Given the raw data file EMPLOYEE.TXT:

The following SAS program is submitted:

What value does the variable idnum contain when the name of the employee is “Ruth”?

Options:

A.

33

B.

22

C.

39

D.

44

Question 8

The following SAS DATA step executes on Monday, April 25, 2000:

data newstaff;

set staff;

start_date = today();

run;

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

Options:

A.

a character string with the value '04/25/2000'

B.

a character string with the value 'Monday, April 25, 2000'

C.

the numeric value 14725, representing the SAS date for April 25, 2000

D.

the numeric value 04252000, representing the SAS date for April 25, 2000

Question 9

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 10

This question will ask you to provide lines of missing code.

The following SAS program is submitted:

Which statement inserted, respectively, in the two locations indicated above create a report stored in a PDF file?

Options:

A.

B.

C.

D.

Question 11

A SAS programmer assigns a library reference to an existing Excel workbook named exceldata.xlsx. Using a DATA step, the programmer attempts to create a worksheet named outdata in this Excel workbook. However, the Excel workbook already contains a worksheet named outdata.

What will happen?

Options:

A.

A second copy of the workbook named exceldata(2).xlsx. will be created with the new worksheet outdata.

B.

A second worksheet outdata(2) will be added to the existing exceldata.xlsx workbook.

C.

The program will overwrite the outdata worksheet in the exceldata.xlsx workbook.

D.

The program will produce an error message indicating that the exceldata.xlsx workbook already exists.

Question 12

The following program is submitted:

Why does the program fail?

Options:

A.

The PAGENO option is invalid in the OPTIONS statement.

B.

The RUN statement is missing after the FORMAT procedure.

C.

The format name contains a period in the VALUE statement.

D.

The LABEL option is missing from the PROC PRINT statement.

Question 13

The contents of the SAS data set PERM.JAN_SALES are listed below:

VARIABLE NAME TYPE

idnum character variable

sales_date numeric date value

A comma delimited raw data file needs to be created from the PERM.JAN_SALES data set. The SALES_DATE values need to be in a MMDDYY10 form.

Which one of the following SAS DATA steps correctly creates this raw data file?

Options:

A.

libname perm 'SAS-data-library';data _null_;set perm.jan_sales;file 'file-specification' dsd = ',';put idnum sales_date : mmddyy10.;run;

B.

libname perm 'SAS-data-library';data _null_;set perm.jan_sales;file 'file-specification' dlm = ',';put idnum sales_date : mmddyy10.;run;

C.

libname perm 'SAS-data-library';data _null_;set perm.jan_sales;file 'file-specification';put idnum sales_date : mmddyy10. dlm = ',';run;

D.

libname perm 'SAS-data-library';data _null_;set perm.jan_sales;file 'file-specification';put idnum sales_date : mmddyy10. dsd = ',';run;

Question 14

The following SAS program is submitted:

libname rawdata1 'location of SAS data library';

filename rawdata2 'location of raw data file';

data work.testdata;

infile

input sales1 sales2;

run;

Which one of the following is needed to complete the program correctly?

Options:

A.

rawdata1

B.

rawdata2

C.

'rawdata1'

D.

'rawdata2'

Question 15

Consider the following data step:

The computed variables City and State have their values assigned using two different methods, a

RETAIN statement and an Assignment statement. Which statement regarding this program is true?

Options:

A.

The RETAIN statement is fine, but the value of City will be truncated to 8 bytes as theLENGTH statement has been omitted.

B.

Both the RETAIN and assignment statement are being used to initialize new variables and are equally efficient. Method used is a matter of programmer preference.

C.

The assignment statement is fine, but the value of City will be truncated to 8 bytes as theLENGTH statement has been omitted.

D.

City's value will be assigned one time, State's value 5 times.

Question 16

The following SAS program is submitted:

data revenue;

set year_1;

var1 = mdy(1,15,1960);

run;

Which one of the following values does the variable named VAR1 contain?

Options:

A.

14

B.

15

C.

1151960

D.

'1/15/1960'

Question 17

The following SAS program is submitted:

What is the initial value of the variable Total in the following program?

Options:

A.

0

B.

Missing

C.

The value of the first observations Wagerate

D.

Cannot be determined from the information given

Question 18

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 19

The following SAS program is submitted:

data work.new;

length word $7;

amount = 7;

if amount = 5 then word = 'CAT';

else if amount = 7 then word = 'DOG';

else word = 'NONE!!!';

amount = 5;

run;

Which one of the following represents the values of the AMOUNT and WORD variables?

Options:

A.

amount word5 DOG

B.

amount word5 CAT

C.

amount word7 DOG

D.

amount word7 ' ' (missing character value)

Question 20

This question will ask you to provide a missing option. Given the following SAS program:

Which option needs to be added to wrap the labels to the next line whenever it encounters an asterisk?

Options:

A.

label = ‘*’

B.

labelsplit = ‘*’

C.

split = ‘*’

D.

wrap = ‘*’

Question 21

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 22

The Excel workbook REGIONS.XLS contains the following four worksheets:

EAST

WEST

NORTH

SOUTH

The following program is submitted:

libname MYXLS 'regions.xls';

Which PROC PRINT step correctly displays the NORTH worksheet?

Options:

A.

proc print data=MYXLS.NORTH;run;

B.

proc print data=MYXLS.NORTH$;run;

C.

proc print data=MYXLS.'NORTH'e;run;

D.

proc print data=MYXLS.'NORTH$'n;run;

Question 23

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 24

Which ODS statement option terminates output being written to an HTML rile?

Options:

A.

END

B.

QUIT

C.

STOP

D.

CLOSE

Question 25

Given the raw data record DEPT:

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

Printing 750

The following SAS program is submitted:

data bonus;

infile ‘dept’;

inputdept$ 1-11 number 13- 15;

run;

Which SAS statement completes the program and results in a value of ‘Printing750’ for the DEPARTMENT variable?

Options:

A.

department = dept II number;

B.

department = left(dept) II number;

C.

department = trim(dept) number;

D.

department=trim(dept)||put(number,3.);

Question 26

The following SAS program is submitted:

data work.flights;

destination = ‘cph’;

select(destination);

when(’LHR’) city = ‘London’;

when(’CPH’) city = ‘Copenhagen’;

otherwise city = ‘Other’;

end;

run;

What is the value of the CITY variable?

Options:

A.

Other

B.

Copenh

C.

Copenhagen

D.

‘‘(missing character value)

Question 27

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 28

The following output is created by the FREQUENCY procedure:

Which TABLES statement was used to completed the following program that produced the output?

proc freq data=sales;

<_insert_code_>

run;

Options:

A.

tables region product;

B.

tables region,product

C.

tables region/product;

D.

tables region*product;

Question 29

Given the contents of the raw data file EMPLOYEE:

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

Alan

19/2/2004

ACCT

Rob

22/5/2004

MKTG

MaryJane

14/3/2004

EDUC

The following SAS program is submitted:

data emps;

infile ‘employee’;

input@1 name$

@15 date

@25 department$;

run;

Which INFORMAT correctly completes the program?

Options:

A.

date9.

B.

ddmmyyyy9.

C.

ddmmyy10.

D.

ddmmyyyy10.

Question 30

The following SAS program is submitted:

Data_null_;

set old;

put sales 1 sales2;

run;

Where is the output written?

Options:

A.

to the SAS log

B.

to the SAS data set _NULL_

C.

to the SAS output window or to an output file

D.

to the raw data file that was most recently opened

Question 31

The SAS data set named WORK.SALARY contains 10 observations for each department, and is currently ordered by Department. The following SAS program is submitted:

Which statement is true?

Options:

A.

The by statement in the DATA step causes a syntax error.

B.

The statement Payroll+(MonthlyWageRate*12); in the data step causes a syntax error.

C.

The values of the variable Payroll represent the monthly total for each department in the WORK.SALARY data set.

D.

The values of the variable Payroll represent a monthly total for all values of WAGERATE in the WORK.SALARY data set.

Question 32

The following SAS program is submitted:

proc contents data = sashelp.class varnum; quit;

What does the VARNUM option print?

Options:

A.

a list of variable names

B.

the total number of variables

C.

a list of the variables in alphabetic order

D.

a list of the variables in the order they were created

Question 33

Given the contents of the raw data file TYPECOLOR.DAT:

The following SAS program is submitted:

What are the values of the variables Type and Color?

Options:

A.

Type=daisy, Color=yellow

B.

Type=daisy, Color=w

C.

Type=daisy, Color=daisyyellow

D.

Type=daisy, Color=

Question 34

Given the raw data file AMOUNT:

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

$1,234

The following SAS program is submitted:

data test;

infile ‘amount’;

input@1 salary 6.;

if_error_then description = ‘Problems’;

else description = ‘No Problems’;

run;

What is the result?

Options:

A.

The value of the DESCRIPTION variable is No Probl.

B.

The value of the DESCRIPTION variable is Problems.

C.

The value of the DESCRIPTION variable is No Problems.

D.

The value of the DESCRIPTION variable can not be determined.

Question 35

A user-defined format has been created using the FORMAT procedure. Where is it stored?

Options:

A.

in a SAS catalog

B.

in an external binary file

C.

in a SAS dataset in the WORK library

D.

in a SAS dataset in a permanent SAS data library

Question 36

The following SAS program is submitted:

data work.sets;

do until (prod gt 6);

prod + 1;

end;

run;

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

Options:

A.

6

B.

7

C.

8

D.

(missing numeric)

Question 37

Given the SAS data set EMPLOYEE INFO:

EMPLOYEE_INFO

IDNumber

Expenses

2542

100.00

3612

133.15

2198

234.34

2198

111.12

The following SAS program is submitted:

proc sort data = employee_info;

run;

Which BY statement completes the program and sorts the data sequentially by ascending expense values within each ascending IDNUMBER value?

Options:

A.

by Expenses IDNumber;

B.

by IDNumber Expenses;

C.

by ascending Expenses IDNumber;

D.

by ascending IDNumber ascending Expenses;

Question 38

The following SAS program is submitted, creating the SAS data set ONE:

data one;

infile ‘file specification’;

input num chars$;

run;

ONE

NUMCHAR

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

123

323

177

The following SAS program is submitted:

proc print data = one;

where char = 23;

run;

What is output?

Options:

A.

NUM CHAR1 772

B.

NUM CHAR1 233 23

C.

NUM CHAR1 233 231 77

D.

No output is generated.

Question 39

The following SAS program is submitted:

What types of variables are DayOfMonth, MonthOfYear, and Year?

Options:

A.

DayOfMonth, Year, and MonthOfYear are character.

B.

DayOfMonth, Year, and MonthOfYear are numeric.

C.

DayOfMonth and Year are numeric. MonthOfYear is character.

D.

DayOfMonth, Year, and MonthOfYear are date values.

Question 40

The following SAS program is submitted:

data test;

set sasuser.employees;

if 2 le years_service le 10 then

amount = 1000;

else amount = 0;

amount_per_year = years_service / amount

run;

What is the value of the variable AMOUNT_PER_YEAR if an employee has been with the company for one year?

Options:

A.

0

B.

0.001

C.

1

D.

. (missing numeric value)

Demo: 40 questions
Total 270 questions