0% found this document useful (0 votes)
79 views

Preguntas 71 85

The document contains questions from a SAS certification exam. It includes multiple choice questions testing knowledge of SAS procedures, DATA step programming, and ODS output. The questions cover topics like using WHERE clauses, arrays, character manipulation functions, and Excel output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views

Preguntas 71 85

The document contains questions from a SAS certification exam. It includes multiple choice questions testing knowledge of SAS procedures, DATA step programming, and ODS output. The questions cover topics like using WHERE clauses, arrays, character manipulation functions, and Excel output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

1

QUESTION: 71

Given the following code:

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


where Sex='M';
run;

How many observations will be displayed?


A. 11
B. 15
C. 10 or fewer
D. 11 or fewer

QUESTION: 72
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:

data WORK.TOTAL;
set WORK.SALARY(keep=Department MonthlyWageRate);
by Department;
if First.Department=1 then Payroll=0;
Payroll+(MonthlyWageRate*12);
if Last.Department=1;
run;

Which statement is true?

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: 73
Given the contents of the raw data file TYPECOLOR.DAT:
----+----10---+----20---+ -- 30 daisyyellow The following SAS program is submitted:

data FLOWERS;
infile 'TYPECOLOR.DAT' truncover;
length
Type $ 5
Color $ 11;
input
Type $
Color $;
run;

What are the values of the variables Type and Color?


2

A. Type=daisy, Color=w
B. Type=daisy, Color=daisyyellow
C. Type=daisy, Color=

QUESTION: 74
The following SAS program is submitted:

data WORK.TEST;
set WORK.MEASLES(keep=Janpt Febpt Marpt);
array Diff{3} Difcount1-Difcount3;
array Patients{3} Janpt Febpt Marpt;
run;

What new variables are created?

A. Difcount1, Difcount2 and Difcount3


B. Diff1, Diff2 and Diff3
C. Janpt, Febpt, and Marpt
D. Patients1, Patients2 and Patients3

QUESTION: 75
Given the raw data record in the file phone.txt:

| 10 | 20 | 30 |
Stevens James SALES 304-923-3721 14
The following SAS program is submitted:
data WORK.PHONES;
infile phone.txt;
input EmpLName $ EmpFName $ Dept $ Phone $ Extension;
<_insert_code_>
run;

Which SAS statement completes the program and results in a value of "James Stevens" for the variableFullName?

A. FullName=CATX(' ',EmpFName,EmpLName);
B. FullName=CAT(' ',EmpFName,EmpLName);
C. FullName=EmpFName!!EmpLName;
D. FullName=EmpFName + EmpLName;

QUESTION: 76
Which statement specifies that records 1 through 10 are to be read from the raw data file customer.txt?

A. infile 'customer.txt' 1-10;


B. input 'customer.txt' stop@10;
C. infile 'customer.txt' obs=10;
D. input 'customer.txt' stop=10;
3

QUESTION: 77
The following SAS program is submitted:

data WORK.ONE;
Text='Australia, US, Denmark';
Pos=find(Text,'US','i',5);
run;

What value will SAS assign to Pos?

A. 0
B. 1
C. 2
D. 12

QUESTION: 78
Given the following raw data records in DATAFILE.TXT:

| 10 | 20 | 30
Kim,Basketball,Golf,Tennis
Bill,Football
Tracy,Soccer,Track
The following program is submitted:
data WORK.SPORTS_INFO;
length Fname Sport1-Sport3 $ 10;
infile 'DATAFILE.TXT' dlm=',';
input Fname $ Sport1 $ Sport2 $ Sport3 $;
run;
proc print data=WORK.SPORTS_INFO;
run;

Which output is correct based on the submitted program?

A. Obs Fname Sport1 Sport2 Sport3


1 Kim Basketball Golf Tennis
2 Bill Football
3 Tracy Soccer Track
B. Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis
2 Bill Football Football Football
3 Tracy Soccer Track Track
C. Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis
2 Bill Football Tracy Soccer
D. Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis
2 Bill Football

QUESTION: 79
4

The SAS data set WORK.ONE contains a numeric variable named Num ana character variable
named Char:

WORK.ONE
Num Char

1 23
3 23
1 77
The following SAS program is submitted:
proc print data=WORK.ONE;
where Num='1';
run;

What is output?

A. Num Char

1 23
B. Num Char

1 23
1 77
C. Num Char

1 23
3 23
1 77
D. No output is generated.

QUESTION: 80
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;
45

A. tables region product;


B. tables region,product
C. tables region/product;
D. tables region*product;

QUESTION: 81
The following SAS program is submitted:

<_insert_ods_code_>
proc means data=SASUSER.SHOES;
where Product in ('Sandal' , 'Slipper' , 'Boot');
run;
<_insert_ods_code_>

Which ODS statements inserted, respectively, in the two location above creates a report stored in
an html file?

A. ods html open='sales.html';


ods html close;
B. ods file='sales.html' / html;
46

ods file close;


C. ods html file='sales.html';
ods html close;
D. ods file html='sales.html';
ods file close;

QUESTION: 82
Given the following data step:

data WORK.GEO;
infile datalines;
input City $20.;
if City='Tulsa' then
State='OK';
Region='Central';
if City='Los Angeles' then
State='CA'
Region='Western';
datalines;
Tulsa
Los Angeles
Bangor
;
run;

After data step execution, what will data set WORK.GEO contain?

A. City State Region

Tulsa OK Western
Los Angeles CA Western
Bangor Western
B. City State Region

Tulsa OK Western
Los Angeles CA Western
Bangor
C. City State Region

Tulsa OK Central
Los Angeles CA Western
Bangor Western
D. City State Region

Tulsa OK Central
Los CA Western
Bangor

QUESTION: 83
Which of the following choices is an unacceptable ODS destination for producing output that can
be viewed in Microsoft Excel?
47

A. MSOFFICE2K
B. EXCELXP
C. CSVALL
D. WINXP

QUESTION: 84
Which statement describes a characteristic of the SAS automatic variable _ERROR_?

A. The _ERROR_ variable maintains a count of the number of data errors in a DATA step.
B. The _ERROR_ variable is added to the program data vector and becomes part of the data set
being created.
C. The _ERROR_ variable can be used in expressions in the DATA step.
D. The _ERROR_ variable contains the number of the observation that caused the data error.

QUESTION: 85
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?

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;

You might also like