SAS认证新题型ADVANCE

更新时间:2023-03-08 10:07:20 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

Item 1 of 63 Mark item for review

When attempting to minimize memory usage, the most efficient way to do group processing when using the MEANS procedure is to use:

A.

the BY statement.

B.

GROUPBY with the NOTSORTED specification.

C.

the CLASS statement.

D.

multiple WHERE statements.

Item 2 of 63 Mark item for review

The SAS data set WORK.CHECK has a variable named Id_Code in it. Which SQL statement would create an index on this variable?

A.

create index Id_Code on WORK.CHECK;

B.

create index(Id_Code) on WORK.CHECK;

C.

make index=Id_Code from WORK.CHECK;

D.

define index(Id_Code) in WORK.CHECK;

Item 3 of 63 Mark item for review

Given the SAS data sets:

WORK.EMPLOYEE WORK.NEWEMPLOYEE

Name Dept Names Salary -------- ----- -------- ------ Alan Sales Michelle 50000 Michelle Sales Paresh 60000

A SAS program is submitted and

the following is written to the SAS log:

101 proc sql;

102 select dept, name 103 from WORK.EMPLOYEE 104 where name=(select names

from newemployee

where salary > 40000) ERROR: Subquery evaluated to more than one row. 105 ; 106 quit;

What would allow the program to

successfully execute without errors?

A.

Replace the where clause with:

where EMPLOYEE.Name=(select Names delimited with ',' from WORK.NEWEMPLOYEE

where Salary > 40000);

B.

Replace line 104 with:

where EMPLOYEE.Name =ANY (select Names separated with ',' from WORK.NEWEMPLOYEE where Salary > 40000);

C.

Replace the equal sign with the IN operator.

D.

Qualify the column names with the table names.

Item 4 of 63 Mark item for review

Given the SAS data set SASUSER.HIGHWAY:

Steering Seatbelt Speed Status Count -------- -------- ----- ------- ----- absent No 0-29 serious 31 absent No 0-29 not 1419 absent No 30-49 serious 191 absent no 30-49 not 2004 absent no 50+ serious 216

The following SAS program is submitted:

proc sql noprint; select distinct

Speed [_insert_SQL_clause_] from SASUSER.HIGHWAY ; quit;

title1 \ proc print data=SASUSER.HIGHWAY; run;

Which SQL clause stores the text 0-29,30-49,50+ in the macro variable GROUPS?

A.

into &GROUPS

B.

into :GROUPS

C.

into :GROUPS separated by ','

D.

into &GROUPS separated by ','

Item 5 of 63 Mark item for review

The SAS data set WORK.CHECK has an index on the variable Code and the following SAS program is submitted.

proc sort data=WORK.CHECK; by Code; run;

Which describes the result of submitting the SAS program?

A.

The index on Code is deleted.

B.

The index on Code is updated.

C.

The index on Code is uneffected.

D.

The sort does not execute.

Item 6 of 63 Mark item for review

The table WORK.PILOTS contains the following data:

WORK.PILOTS

Id Name Jobcode Salary --- ------ ------- ------ 001 Albert PT1 50000 002 Brenda PT1 70000 003 Carl PT1 60000 004 Donna PT2 80000

005 Edward PT2 90000 006 Flora PT3 100000

The data set was summarized to include average salary based on jobcode:

Jobcode Salary Avg ------- ------ ----- PT1 50000 60000 PT1 70000 60000 PT1 60000 60000 PT2 80000 85000 PT2 90000 85000 PT3 100000 100000

Which SQL statement could NOT generate this result?

A. select

Jobcode, Salary,

avg(Salary) label='Avg' from WORK.PILOTS group by Jobcode order by Id ;

B. select

Jobcode, Salary,

(select avg(Salary)

from WORK.PILOTS as P1

where P1.Jobcode=P2.Jobcode) as Avg from WORK.PILOTS as P2 order by Id ;

C. select

Jobcode, Salary,

(select avg(Salary) from WORK.PILOTS

group by Jobcode) as Avg from WORK.PILOTS order by Id ;

D. select

Jobcode, Salary, Avg from

WORK.PILOTS, (select

Jobcode as Jc, avg(Salary) as Avg from WORK.PILOTS group by 1) where Jobcode=Jc order by Id ;

Item 7 of 63 Mark item for review

A quick rule of thumb for the space required to run PROC SORT is:

A.

two times the size of the SAS data set being sorted.

B.

three times the size of the SAS data set being sorted.

C.

four times the size of the SAS data set being sorted.

D.

five times the size of the SAS data set being sorted.

Item 8 of 63 Mark item for review

Multi-threaded processing for PROC SORT will effect which of these system resources?

A.

CPU time will decrease,

wall clock time will decrease

B.

CPU time will increase,

wall clock time will decrease

C.

CPU time will decrease,

wall clock time will increase

D.

CPU time will increase, wall clock time will increase

Item 9 of 63 Mark item for review

Given the SAS data set WORK.TRANSACT:

Rep Cost Ship ----- ----- ----- SMITH 200 50 SMITH 400 20 JONES 100 10 SMITH 600 100 JONES 100 5

The following output is desired:

Rep

----- ---- JONES 105 SMITH 250

Which SQL statement was used?

A. select rep,

min(Cost+Ship)

from WORK.TRANSACT order by Rep ;

B. select Rep,

min(Cost,Ship) as Min from WORK.TRANSACT summary by Rep order by Rep ;

C. select Rep,

min(Cost,Ship)

from WORK.TRANSACT group by Rep order by Rep ;

D. select Rep,

min(Cost+Ship)

from WORK.TRANSACT group by Rep order by Rep ;

Item 10 of 63 Mark item for review

The following SAS program is submitted: %let Value=9; %let Add=5;

%let Newval=%eval(&Value/&Add); %put &Newval;

What is the value of the macro variable Newval when the %PUT statement executes?

A. 0.555

B. 2

C. 1.8

D. 1

Item 11 of 63 Mark item for review

The following SAS code is submitted:

data WORK.TEMP WORK.ERRORS / view=WORK.TEMP; infile RAWDATA; input Xa Xb Xc;

if Xa=. then output WORK.ERRORS; else output WORK.TEMP; run;

Which of the following is true of the WORK.ERRORS data set?

A.

The data set is created when the DATA step is submitted.

B.

The data set is created when the view TEMP is used in another SAS step.

C.

The data set is not created because the DATA statement contains a syntax error.

D.

The descriptor portion of WORK.ERRORS is created when the DATA step is submitted.

Item 12 of 63 Mark item for review

Which title statement would always display the current date?

A.

title \

B.

title \

C.

title \

D.

title \

Item 13 of 63 Mark item for review

Given the SAS data sets:

WORK.ONE WORK.TWO

Id Name Id Salary --- ------ --- ------ 112 Smith 243 150000 243 Wei 355 45000 457 Jones 523 75000

The following SAS program is submitted:

data WORK.COMBINE;

merge WORK.ONE WORK.TWO; by Id; run;

Which SQL procedure statement produces the same results?

A.

create table WORK.COMBINE as select Id,

Name, Salary from

WORK.ONE full join WORK.TWO on ONE.Id=TWO.Id ;

B.

create table WORK.COMBINE as select

coalesce(ONE.Id, TWO.Id) as Id, Name, Salary from

WORK.ONE, WORK.TWO

where ONE.Id=TWO.Id ;

C.

create table WORK.COMBINE as

select

coalesce(ONE.Id, TWO.Id) as Id, Name, Salary from

WORK.ONE full join WORK.TWO on ONE.Id=TWO.Id order by Id ;

D.

create table WORK.COMBINE as select

coalesce(ONE.Id, TWO.Id) as Id, Name, Salary from

WORK.ONE, WORK.TWO

where ONE.Id=TWO.Id order by ONE.Id ;

Item 14 of 63 Mark item for review

The following SAS program is submitted:

proc contents data=TESTDATA.ONE; run;

Which SQL procedure step produces similar information about the column attributes of TESTDATA.ONE?

A.

proc sql;

contents from TESTDATA.ONE;

quit;

B.

proc sql;

describe from TESTDATA.ONE; quit;

C.

proc sql;

contents table TESTDATA.ONE; quit;

D.

proc sql;

describe table TESTDATA.ONE; quit;

Item 15 of 63 Mark item for review

Given the SAS data set WORK.ONE:

Rep Cost ----- ---- SMITH 200 SMITH 400 JONES 100 SMITH 600 JONES 100

The following SAS program is submitted;

proc sql; select Rep, avg(Cost) from WORK.ONE order by Rep ; quit;

Which result set would be generated?

A.

JONES 280 JONES 280 SMITH 280 SMITH 280 SMITH 280

B.

JONES 600 SMITH 100

C.

JONES 280 SMITH 280

D.

JONES 100 JONES 100 SMITH 600 SMITH 600 SMITH 600

Item 16 of 63 Mark item for review

Given the SAS data sets:

WORK.MATH1A WORK.MATH1B

Name Fi Name Fi ------- -- ------ -- Lauren L Smith M Patel A Lauren L Chang Z Patel A Hillier R

The following SAS program is submitted:

proc sql;

select *

from WORK.MATH1A

[_insert_set_operator_] select *

from WORK.MATH1B ; quit;

The following output is desired:

Name Fi ------- -- Lauren L Patel A Chang Z Hillier R Smith M Lauren L Patel A

Which SQL set operator completes the program and generates the desired output?

A. append corr

B. union corr

C.

outer union corr

D.

intersect corr

Item 17 of 63 Mark item for review

Which of the following is an advantage of SAS views?

A.

SAS views can access the most current data in files that are frequently updated.

B.

SAS views can avoid storing a SAS copy of a large data file.

C.

SAS views can decrease programming time.

D.

both A and B are true

Item 18 of 63 Mark item for review

In what order does SAS search for format definitions by default?

A.

1. WORK.FORMATS 2. LIBRARY.FORMATS

B.

1. LIBRARY.FORMATS 2. WORK.FORMATS

C.

There is no default order,

it must be defined by the user.

D.

All user defined libraries that have a catalog named FORMATS, in alphabetic order.

Item 19 of 63 Mark item for review

Given the dataset WORK.STUDENTS:

Name Age ------- --- Mary 15 Philip 16 Robert 12 Ronald 15

The following SAS program is submitted:

%let Value=Philip;

proc print data=WORK.STUDENTS; [_insert_WHERE_statement_] run;

Which WHERE statement successfully completes the program and produces a report?

A.

where upcase(Name)=upcase(&Value);

B.

where upcase(Name)=%upcase(&Value);

C.

where upcase(Name)=\

D.

where upcase(Name)=\

Item 20 of 63 Mark item for review

The following SAS program is submitted:

data WORK.TEMP;

length A B 3 X; infile RAWDATA; input A B X; run;

What is the length of variable A?

A. 3

B. 8

C.

WORK.TEMP is not created - X has an invalid length.

D. Unknown.

Item 21 of 63 Mark item for review

The following SAS program is submitted:

data WORK.NEW;

do i=1, 2, 3;

Next=cats('March' || i ); infile XYZ filevar=Next end=Eof; do until (Eof);

input Dept $ Sales; end; end; run;

The purpose of the FILEVAR=option on the INFILE statement is to name the variable

Next, whose value:

A.

points to a new input file.

B.

is output to the SAS data set WORK.NEW.

C.

is an input SAS data set reference.

D.

points to an aggregate storage location.

Item 22 of 63 Mark item for review

Given the following partial SAS log:

NOTE: SQL table SASHELP.CLASS was created like:

create table SASHELP.CLASS( bufsize=4096 ) (

Name char(8), Sex char(1), Age num, Height num, Weight num );

Which SQL procedure statement generated this output?

A.

CONTENTS FROM SASHELP.CLASS;

B.

CREATE FROM SASHELP.CLASS INTO LOG;

C.

DESCRIBE TABLE SASHELP.CLASS;

D.

VALIDATE SELECT * FROM SASHELP.CLASS;

Item 23 of 63 Mark item for review

Given the SAS data set SASUSER.HIGHWAY:

Steering Seatbelt Speed Status Count -------- -------- ----- ------- ----- absent No 0-29 serious 31 absent No 0-29 not 1419 absent No 30-49 serious 191 absent no 30-49 not 2004 absent no 50+ serious 216

The following SAS program is submitted:

%macro SPLIT; proc sort

data=SASUSER.HIGHWAY

out=WORK.UNIQUES(keep=Status) nodupkey; by Status; run;

data _null_;

set uniques end=Lastobs;

call symputx('Status'||left(_n_),Status); if Lastobs then call symputx('Count',_n_); run;

%local i; data

%do i=1 %to &count; [_insert_reference_] %end; ;

A 13 3 B 14 4 B 9 2

B.

Common X Y ------ -- -- A 10 1 A 13 3 A 14 3 B 9 4 B 9 2

C.

Common X Y ------ -- -- A 10 1 A 13 3 A 14 . B 9 4 B . 2

D.

Common X Y ------ -- -- A 10 1 A 13 1 A 14 1 A 10 3 A 13 3 A 14 3 B 9 4 B 9 2

Item 28 of 63 Mark item for review

Which of the following ARRAY statements is similar to the statement array Yr{1974:2007} Yr1974-Yr2007; and will compile without errors?

A.

array Yr{34} Yr1974-Yr2007;

B.

array Yr{74:07} Yr1974-Yr2007;

C.

array Yr{74-07} Yr1974-Yr2007;

D.

array Yr{1974-2007} Yr1974-Yr2007;

Item 29 of 63 Mark item for review

The following program is submitted to check

the variables Xa, Xb, and Xc in the SASUSER.LOOK data set:

data _null_ WORK.BAD_DATA / view=WORK.BAD_DATA ; set SASUSER.LOOK(keep=Xa Xb Xc); length _Check_ $ 10 ;

if Xa=. then _check_=trim(_Check_)!!\ if Xb=. then _check_=trim(_Check_)!!\ if Xc=. then _check_=trim(_Check_)!!\ put Xa= Xb= Xc= _check_= ; run ;

When is the PUT statement executed?

A.

when the code is submitted

B.

only when the WORK.BAD_DATA view is used

C.

both when the code is submitted and the view is used

D.

never, the use of _null_ in a view is a syntax error

Item 30 of 63 Mark item for review

The following SAS program is submitted:

%let product=merchandise;

[_insert_%put_statement_]

and the following message is written to the SAS log:

the value is \

Which macro statement wrote this message?

A.

%put the value is '\

B.

%put the value is %quote(&product.);

C.

%put the value is \

D.

%put the value is \

Item 31 of 63 Mark item for review

Given the SAS data sets:

WORK.ONE WORK.TWO

X Y SumY -- -- ----

A 10 36 A 3 A 14 B 9

The following SAS DATA step is submitted:

data WORK.COMBINE;

if _n_=1 then set WORK.TWO; set WORK.ONE; run;

What data values are stored in data set WORK.COMBINE?

A.

An ERROR message is written to the SAS log and the data set WORK.COMBINE is not created.

B.

SumY X Y ---- -- -- 36 A 10

C.

SumY X Y ---- -- -- 36 A 10 . A 3 . A 14 . B 9

D.

SumY X Y ---- -- -- 36 A 10 36 A 3 36 A 14 36 B 9

Item 32 of 63 Mark item for review

The following SAS program is submitted:

data WORK.NEW(bufno=4); set WORK.OLD(bufno=3); run;

Why are the BUFNO options used?

A.

to reduce memory usage

B.

to reduce CPU time usage

C.

to reduce the amount of data read

D.

to reduce the number of I/O operations

Item 33 of 63 Mark item for review

Given the following program and desired results:

%let Thing1=gift; %let Thing2=surprise; %let Gift1=book; %let Gift2=jewelry; %let Surprise1=dinner; %let Surprise2=movie;

%let Pick=2;

%let Choice=surprise;

Desired %PUT Results in LOG: My favorite surprise is a movie

What is the correct %PUT statement that generates the desired results?

A.

%put My favorite &Thing&Pick is a &&Choice&Pick;

B.

%put My favorite &&Thing&pick is a &&&Choice&Pick;

C.

%put My favorite &Choice&pick is a &&Thing&Pick;

D.

%put My favorite &&Choice&pick is a &&&Thing&Pick;

Item 34 of 63 Mark item for review

Given the SAS dataset WORK.ONE

Name Salary ----- ------ Hans 200 Maria 205 Jose 310 Ariel 523

The following SAS program is submitted:

proc sql;

[_insert_select_clause_] from WORK.ONE ; quit;

The following output is desired:

Salary Bonus ------ ----- 200 20 205 20.5 310 31 523 52.3

Which SQL procedure clause completes

the program and generates the desired output?

A.

select Salary Bonus as Salary*.10 as Bonus

B.

select Salary Bonus=Salary*.10 'Bonus'

C.

select Salary, Salary*.10 label='Bonus'

D.

select Salary, Salary*.10 column=\Item 35 of 63 Mark item for review

The following SAS program is submitted:

options reuse=YES;

data SASUSER.REALESTATE(compress=CHAR); set SASUSER.HOUSES; run;

What is the effect of

the reuse=YES SAS system option?

A.

It allows updates in place.

B.

It tracks and recycles free space.

C.

It allows a permanently stored SAS data set to be replaced.

D.

It allows users to access the same SAS data set concurrently.

Item 36 of 63 Mark item for review

Which statement is true for Data step HASH objects?

A.

The key component must be numeric.

B.

The data component may consist of numeric and character values.

C.

The HASH object is created in one step and referenced in another.

D.

The HASH object must be smaller than 2 to the 8th power bytes.

Item 37 of 63 Mark item for review

Given the SAS data sets:

WORK.CLASS1 WORK.CLASS2

Name Course Name Class ------ ------ ------- ----- Lauren MATH1 Smith MATH2 Patel MATH1 Farmer MATH2 Chang MATH1 Patel MATH2

Chang MATH3 Hillier MATH2

The following SAS program is submitted:

proc sql; select Name

from WORK.CLASS1

[_insert_set_operator_] select Name

from WORK.CLASS2 ; quit;

The following output is desired:

Name ------ Chang Chang Lauren

Which SQL set operator completes the program and generates the desired output?

A.

intersect corr

B. except all

C.

intersect all

D.

left except

Item 38 of 63 Mark item for review

The following SAS program is submitted:

%macro CHECK(Num=4);

%let Result=%eval(&Num gt 5); %put Result is &result; %mend;

%check(Num=10)

What is written to the SAS log?

A.

Result is 0

B.

Result is 1

C.

Result is 10 gt 5

D.

Result is true

Item 39 of 63 Mark item for review

The following SAS program is submitted:

%let Mv=shoes;

%macro PRODUCT(Mv=bicycles); %let Mv=clothes; %mend;

%PRODUCT(Mv=tents) %put Mv is &Mv;

What is written to the SAS log?

A.

Mv is bicycles

B.

Mv is clothes

C.

Mv is shoes

D.

Mv is tents

Item 40 of 63 Mark item for review

Which of the following SAS System options can aid in benchmarking?

A.

BUFSIZE= and BUFNO=

B.

FULLSTIMER

C.

IOBLOCKSIZE=

D. SYSTIMER

Item 41 of 63 Mark item for review

Given the following macro program:

%macro MAKEPGM(NEWNAME, SETNAME, PRINT); data &NEWNAME; set &SETNAME; run;

%if &PRINT=YES %then %do;

proc print data=&NEWNAME.(obs=10); run ; %end; %mend;

Which option would provide feedback in the log about the parameter values passed into this macro when invoked?

A. MPRINT

B. MDEBUG

C. MLOGIC

D. MPARAM

Item 42 of 63 Mark item for review

The NOTSORTED option on the BY statement cannot be used with which other statement or option?

A. SET

B. MERGE

C.

IF FIRST.by-variable

D.

BY GROUPFORMAT by-variable

Item 43 of 63 Mark item for review

Given the SAS data set WORK.ONE:

Rep Cost ----- ---- SMITH 200 SMITH 400 JONES 100 SMITH 600 JONES 100

The following SAS program is submitted:

proc sql; select Rep,

avg(Cost) as Average from WORK.ONE

[either__insert_SQL_where_clause_] group by Rep

[_or_ _insert_SQL_having_clause_] ; quit;

The following output is desired:

Rep Average ----- ------- SMITH 400

Which SQL clause completes the program and generates the desired output?

A.

where calculated Average > (select avg(Cost) from WORK.ONE)

B.

having Average > (select avg(Cost) from WORK.ONE)

C.

having avg(Cost) < (select avg(Cost) from WORK.ONE)

D.

where avg(Cost) > (select avg(Cost) from WORK.ONE)

Item 44 of 63 Mark item for review

Which dictionary table provides

information on each occurrence of the variable named LastName?

A.

DICTIONARY.TABLES

B.

DICTIONARY.COLUMNS

C.

DICTIONARY.MEMBERS

D.

DICTIONARY.VARIABLES

Item 45 of 63 Mark item for review

To create a list of unique Customer_Id

values from the customer data set, which of the following techniques can be used?

technique 1: proc SORT with NODUPKEY and OUT=

technique 2: data step with IF FIRST.Customer_Id=1 technique 3: proc SQL with the SELECT DISTINCT statement

A.

only technique 1

B.

techniques 1 and 2

C.

techniques 1 and 3

D.

techniques 1, 2, or 3

Item 46 of 63 Mark item for review

Given the SAS data sets:

WORK.CLASS1 WORK.CLASS2

Name Course Name Class ------ ------ ------ ----- Lauren MATH1 Smith MATH2 Patel MATH1 Farmer MATH2 Chang MATH1 Patel MATH2 Hillier MATH2

The following SAS program is submitted:

proc sql; select Name

from WORK.CLASS1

[_insert_set_operator_] select Name

from WORK.CLASS2 ; quit;

The following output is desired:

Name

本文来源:https://www.bwwdw.com/article/bxy3.html

Top