SAS advance 63

Description

Quiz on SAS advance 63, created by Grace Li on 26/09/2018.
Grace Li
Quiz by Grace Li, updated more than 1 year ago
Grace Li
Created by Grace Li about 6 years ago
559
2

Resource summary

Question 1

Question
1. When attempting to minimize memory usage, the most efficient way to do group processing when using the MEANS procedure is to use:
Answer
  • A. the BY statement.
  • B. GROUPBY with the NOTSORTED specification.
  • C. the CLASS statement.
  • D. multiple WHERE statements.

Question 2

Question
2. The SAS data set WORK.CHECK has a variable named Id_Code in it. Which SQL statement would create an index on this variable?
Answer
  • 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;

Question 3

Question
3. Given the SAS data sets: What would allow the program to successfully execute without errors?
Answer
  • 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.

Question 4

Question
4. Given the SAS data set SASUSER.HIGHWAY: Which SQL clause stores the text 0-29, 30-49, 50+ in the macro variable GROUPS?
Answer
  • A. into &GROUPS
  • B. into :GROUPS
  • C. into :GROUPS separated by ','
  • D. into &GROUPS separated by ','

Question 5

Question
5. 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?
Answer
  • 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.

Question 6

Question
6. The table WORK.PILOTS contains the following data: Which SQL statement could NOT generate this result?
Answer
  • 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 ; (define variable Avg in subquery in from clause.)

Question 7

Question
7. A quick rule of thumb for the space required to run PROC SORT is:
Answer
  • 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.

Question 8

Question
8. Multi-threaded processing for PROC SORT will affect which of these system resources?
Answer
  • 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

Question 9

Question
9. Given the SAS data set WORK.TRANSACT: Which SQL statement was used?
Answer
  • A. select rep, min(Cost+Ship) from WORK.TRANSACT order by Rep ;
  • 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 ;

Question 10

Question
10. (%EVAL) 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?
Answer
  • A. 0.555
  • B. 2
  • C. 1.8
  • D. 1

Question 11

Question
11. 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?
Answer
  • 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.

Question 12

Question
12. Which title statement would always display the current date?
Answer
  • A. title "Today is: &sysdate.";
  • B. title "Today is: &sysdate9.";
  • C. title "Today is: &today.";
  • D. title "Today is: %sysfunc(today(),worddate.)";

Question 13

Question
13. Given the SAS data sets: Which SQL procedure statement produces the same results?
Answer
  • 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 ;

Question 14

Question
14. 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?
Answer
  • 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;

Question 15

Question
15. Given the SAS data set WORK.ONE: Which result set would be generated?
Answer
  • 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

Question 16

Question
16. Given the SAS data sets: 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?
Answer
  • A. append corr
  • B. union corr
  • C. outer union corr
  • D. intersect corr

Question 17

Question
17. Which of the following is an advantage of SAS views?
Answer
  • 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

Question 18

Question
18. In what order does SAS search for format definitions by default?
Answer
  • 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.

Question 19

Question
19. Function %UPCASE: Which WHERE statement successfully completes the program and produces a report?
Answer
  • A. where upcase(Name)=upcase(&Value);
  • B. where upcase(Name)=%upcase(&Value);
  • C. where upcase(Name)="upcase(&Value)";
  • D. where upcase(Name)="%upcase(&Value)";

Question 20

Question
20. 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?
Answer
  • A. 3
  • B. 8
  • C. WORK.TEMP is not created - X has an invalid length.
  • D. Unknown.

Question 21

Question
21. The following SAS program is submitted: The purpose of the FILEVAR=option on the INFILE statement is to name the variable Next, whose value:
Answer
  • 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.

Question 22

Question
22. DESCRIBE TABLE Statement 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?
Answer
  • A. CONTENTS FROM SASHELP.CLASS;
  • B. CREATE FROM SASHELP.CLASS INTO LOG;
  • C. DESCRIBE TABLE SASHELP.CLASS;
  • D. VALIDATE SELECT * FROM SASHELP.CLASS;

Question 23

Question
23. Given the SAS data set SASUSER.HIGHWAY: What macro variable reference completes the program to create the WORK.NOT and WORK.SERIOUS data sets?
Answer
  • A. &Status&i
  • B. &&Status&i
  • C. &Status&Count
  • D. &&Status&Count

Question 24

Question
24. The following SAS program is submitted: %let Num1=7; %let Num2=3; %let Result=%eval(&Num1/&Num2); %put &Result; What is the value of the macro variable Result when the %PUT statement executes?
Answer
  • A. 2.3
  • B. 2
  • C. . (missing value)
  • D. 2.33333333333333

Question 25

Question
25. Macros That Include Keyword Parameters: Given the SAS data set SASUSER.HIGHWAY: How many observations appear in the generated report?
Answer
  • A. 0
  • B. 2
  • C. 3
  • D. 5

Question 26

Question
26. Given the following SAS data sets: Which of the following SQL statements was most likely used to generate this result?
Answer
  • A. select Id, sum(Expense) label='COST' from WORK.VISIT1 group by 1 union all select Id, sum(Cost) from WORK.VISIT2 group by 1 order by 1,2 ;
  • B. select id, sum(expense) as COST from WORK.VISIT1(rename=(Expense=Cost)), WORK.VISIT2 where VISIT1.Id=VISIT2.Id group by Id order by Id, Cost ;
  • C. select VISIT1.Id, sum(Cost) as Cost from WORK.VISIT1(rename=(Expense=Cost)), WORK.VISIT2 where VISIT1.Id=VISIT2.Id group by Id order by Id, Cost ;
  • D. select Id, sum(Expense) as Cost from WORK.VISIT1 group by Id outer union corr select Id, sum(Cost) from WORK.VISIT2 group by Id order by 1,2 ;

Question 27

Question
27. Given the SAS data sets: What data values are stored in data set WORK.COMBINE?

Question 28

Question
28. Which of the following ARRAY statements is similar to the statement array Yr{1974:2007} Yr1974-Yr2007; and will compile without errors?
Answer
  • 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;

Question 29

Question
29. 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_)!!" Xa" ; if Xb=. then _check_=trim(_Check_)!!" Xb" ; if Xc=. then _check_=trim(_Check_)!!" Xc" ; put Xa= Xb= Xc= _check_= ; run ; When is the PUT statement executed?
Answer
  • 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

Question 30

Question
30. 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 "merchandise"
Answer
  • A. %put the value is '"'&product.'"';
  • B. %put the value is %quote(&product.);
  • C. %put the value is "&product.";
  • D. %put the value is ""&product."";

Question 31

Question
31. Given the SAS data sets: What data values are stored in data set WORK.COMBINE?
Answer
  • 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

Question 32

Question
32. The following SAS program is submitted: data WORK.NEW(bufno=4); set WORK.OLD(bufno=3); run; Why are the BUFNO options used?
Answer
  • 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

Question 33

Question
33. 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?
Answer
  • 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;

Question 34

Question
34. Given the SAS dataset WORK.ONE Which SQL procedure clause completes the program and generates the desired output?
Answer
  • A. select Salary Bonus as Salary*.10
  • B. select Salary Bonus=Salary*.10 'Bonus'
  • C. select Salary, Salary*.10 label='Bonus'
  • D. select Salary, Salary*.10 column="Bonus"

Question 35

Question
35. 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?
Answer
  • 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.

Question 36

Question
36. Which statement is true for Data step HASH objects?
Answer
  • 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.

Question 37

Question
37. Given the SAS data sets: Which SQL set operator completes the program and generates the desired output?
Answer
  • A. intersect corr
  • B. except all
  • C. intersect all
  • D. left except

Question 38

Question
38. 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?
Answer
  • A. Result is 0
  • B. Result is 1
  • C. Result is 10 gt 5
  • D. Result is true

Question 39

Question
39. 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?
Answer
  • A. Mv is bicycles
  • B. Mv is clothes
  • C. Mv is shoes
  • D. Mv is tents

Question 40

Question
40. Which of the following SAS System options can aid in benchmarking?
Answer
  • A. BUFSIZE= and BUFNO=
  • B. FULLSTIMER
  • C. IOBLOCKSIZE=
  • D. SYSTIMER

Question 41

Question
41. Given the following macro program: Which option would provide feedback in the log about the parameter values passed into this macro when invoked?
Answer
  • A. MPRINT
  • B. MDEBUG
  • C. MLOGIC
  • D. MPARAM

Question 42

Question
42. The NOTSORTED option on the BY statement cannot be used with which other statement or option?
Answer
  • A. SET
  • B. MERGE
  • C. IF FIRST.by-variable
  • D. BY GROUPFORMAT by-variable

Question 43

Question
43. Given the SAS data set WORK.ONE: Rep Cost ----- ---- SMITH 200 SMITH 400 JONES 100 SMITH 600 JONES 100 Which SQL clause completes the program and generates the desired output?
Answer
  • 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)

Question 44

Question
44. Which dictionary table provides information on each occurrence of the variable named LastName?
Answer
  • A. DICTIONARY.TABLES
  • B. DICTIONARY.COLUMNS
  • C. DICTIONARY.MEMBERS
  • D. DICTIONARY.VARIABLES

Question 45

Question
45. 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
Answer
  • A. only technique 1
  • B. techniques 1 and 2
  • C. techniques 1 and 3
  • D. techniques 1, 2, or 3

Question 46

Question
46. Given the SAS data sets: Which SQL set operator completes the program and generates the desired output?
Answer
  • A. intersect corr
  • B. except
  • C. intersect
  • D. left except

Question 47

Question
47. The following SAS program is submitted: Which statement completes the program so that the PROC PRINT step executes on Thursday?
Answer
  • A. if &sysday = Thursday then %do;
  • B. %if &sysday = Thursday %then %do;
  • C. %if "&sysday" = Thursday %then %do;
  • D. %if &sysday = "Thursday" %then %do;

Question 48

Question
48. Given the following program and data: What is the WHERE statement that successfully completes the PROC PRINT and selects the observation for Barb?
Answer
  • A. where Birthday=&Want;
  • B. where Birthday="&Want";
  • C. where Birthday="&Want"d;
  • D. where Birthday='&Want'd;

Question 49

Question
49. Which macro statement would remove the macro variable Mv_Info from the symbol table?
Answer
  • A. %mdelete &Mv_Info;
  • B. %symerase Mv_Info;
  • C. %symdel &Mv_Info;
  • D. %symdel Mv_Info;

Question 50

Question
50. The table WORK.PILOTS contains the following data: Which select statement could NOT have produced this output?

Question 51

Question
51. The SAS data set WORK.TEMP is indexed on the variable Id: Which BY statement completes the program, creates a listing report that is grouped by Id, and completes without errors?
Answer
  • A. by Id;
  • B. by Id grouped;
  • C. by Id descending;
  • D. by descending Id;

Question 52

Question
52. To create a dataset with unique values of a given variable using a data step and the FIRST. VARIABLES and LAST.VARIABLES, it is assumed that the input dataset is:
Answer
  • A. sorted on that variable.
  • B. indexed by that variable.
  • C. naturally in order.
  • D. any of the above A, B, or C

Question 53

Question
53.The SASFILE statement requests that a SAS data set be opened and loaded into memory:
Answer
  • A. one page at a time.
  • B. one variable at a time.
  • C. one observation at a time.
  • D. in its entirety, if possible.

Question 54

Question
54. The following SAS program is submitted: %let Name1=Shoes; %let Name2=Clothes; %let Root=name; %let Suffix=2; %put &&&Root&Suffix; What is written to the SAS log?
Answer
  • A. &Name2
  • B. Clothes
  • C. &&&Root&Suffix
  • D. WARNING: Apparent symbolic reference ROOT2 not resolved.

Question 55

Question
55. Given the SAS data sets: Which join operator completes the program and generates the desired output?
Answer
  • A. left join
  • B. right join
  • C. full join
  • D. outer join

Question 56

Question
56. The SAS data set WORK.ADDRESSES contains the email addresses of The XYZ Corporation's customers in a variable named Email_Address. The following DATA step is submitted: Which statement completes the program and creates a SAS program file?
Answer
  • A. infile "c:\email.sas";
  • B. output "c:\email.sas";
  • C. file "c:\email.sas";
  • D. None of the above.

Question 57

Question
57. Which of the following is true about the COMPRESS=YES data set option?
Answer
  • A. It uses the Ross Data Compression method to compress numeric data.
  • B. It is most effective with character data that contains repeated characters.
  • C. It is most effective with numeric data that represents large numeric values.
  • D. It is most effective with character data that contains patterns, rather than simple repetitions.

Question 58

Question
Given the SAS dataset WORK.ONE: Salary ------ 200 205 . 523 Which WHERE expression completes the program and generates the desired output?
Answer
  • A. where Salary is not .
  • B. where Salary ne missing
  • C. where Salary ne null
  • D. where Salary is not missing

Question 59

Question
59. The SAS data set WORK.TEST has an index on the variable Id and the following SAS program is submitted.
Answer
  • A. The index on Id is deleted.
  • B. The index on Id is updated as an index on Id_Code.
  • C. The index on Id is deleted and an index on Id_Code is created.
  • D. The index on Id is recreated as an index on Id_Code.

Question 60

Question
Given the data set SASHELP.CLASS: Which PROC steps execute successfully?
Answer
  • A. PROC MEANS only
  • B. PROC PRINT only
  • C. PROC MEANS and PROC PRINT
  • D. No PROC steps execute successfully

Question 61

Question
61. In a data step merge, the BY variables in all data sets must have the same:
Answer
  • A. name.
  • B. name and type.
  • C. name and length.
  • D. name, type, and length.

Question 62

Question
62. Given the following macro program and invocation: Which of these choices shows the correct %PUT statement output if the program is submitted at the beginning of a new SAS session? Note that other lines may be written to the SAS log by the program, but only the %PUT output is shown here.
Answer
  • A. ---> inside macro WORK.NEW SASHELP.CLASS ---> outside invocation WORK.NEW SASHELP.CLASS
  • B. ---> inside macro WORK.NEW SASHELP.CLASS ---> outside invocation &NEWNAME &SETNAME
  • C. ---> inside macro &NEWNAME &SETNAME ---> outside invocation WORK.NEW SASHELP.CLASS
  • D. ---> inside macro &NEWNAME &SETNAME ---> outside invocation &NEWNAME &SETNAME

Question 63

Question
63. The following SAS program is submitted: Which VAR statement successfully completes the program to produce a report containing four variables?
Answer
  • A. var %COLS1 %COLS2;
  • B. var %COLS1-%COLS2;
  • C. var %COLS1 Weight Height;
  • D. var Weight Height %COLS1;

Question 64

Question
如何在 Log 中輸出 global macro variables %put [blank_start]GLOBAL[blank_end]
Answer
  • _GLOBAL_

Question 65

Question
選出 unique value of a grouped variable If [blank_start]first.model[blank_end] =1 then output=xxx (model 是這個 variable 的名字)
Answer
  • first.model

Question 66

Question
outer union [blank_start]corr[blank_end]
Answer
  • corr

Question 67

Question
A Data has 2000million observations and 300 Character variables Compress=[blank_start]YES[blank_end]
Answer
  • YES

Question 68

Question
Data Set ONE State_ID state TWO State_ID City Quit 前的最後一句: Ask: where s.state= [blank_start]“&selection”[blank_end] (注意一定要加引號)
Answer
  • "&selection"

Question 69

Question
HASH object [blank_start]HashAlpha[blank_end]
Answer
  • HashAlpha

Question 70

Question
Given 2 Data Set ONE Name Year Joyce 9 John 4 John 2 Jane 6 Thomas 8 TWO Name Age(不需要理會) Joyce John Thomas Robert Jeff The following SAS program is submitted: select Name, avg(Year) as average from WORK.ONE Except Corr WORK.TWO .............. quit; Average of [blank_start]7[blank_end]
Answer
  • 7

Question 71

Question
FCMP 填空 proc fcmp outlib=sasuser.funcs.trial; ... endsub; options [blank_start]cmplib[blank_end] =sasuser.funcs; data null; ... run;
Answer
  • cmplib

Question 72

Question
Given data set and macro program, choose missing correct code call symputx('&Num', California)
Answer
  • True
  • False

Question 73

Question
the first part of code gives Key:valuepair definition, the variables are somekey and someAlpha, we need to fill in the hash object definition. Some.definedata( [blank_start]“ someAlpha”[blank_end] );
Answer
  • "someAlpha"

Question 74

Question
declare has Goal(); Goal.definekey(“QtrNum”); Goal.definedata([blank_start]“GoalAmount”[blank_end]); Goal.definedone();
Answer
  • “GoalAmount”

Question 75

Question
repeated need a local data set, what kind of effect does SASFILE statement has to the Global statement.
Answer
  • reduce CPU
  • reduce I/O
  • increase memory

Question 76

Question
考察in line view。程序大致如下: proc sql; create table forecast as select a.*, b.sales from actual a,_______ where a.dept=b.dept quit;
Answer
  • (select avg(revenue) as average from Budegt group by 1) b
  • select ( avg(revenue) as average from Budegt group by 1) b

Question 77

Question
%let this_year=%substr(&sysdate9,6); %let next_year=&this_year+1; %let check_year=%eval(&next_year<2016); %put two years after this year is &next_year+1; %put &check_year is &check_year; Assume system time is 01Jan2013, what is the output?
Answer
  • two years after this year is 2013+1+1
  • check_year is 1

Question 78

Question
A data set has 300,000 observations, 20 character variables, 50 numeric variables, 我们需要 其中的 5 character variables 和 7 numeric variables,which is most efficient:
Answer
  • A. DROP= option in data step
  • B. KEEP= option in data step
  • C. KEEP= option in set statement
  • D. KEEP statement

Question 79

Question
Array multi{1:2,2} (1,2); Do i=1 to 2; Do j=1 to 2; Output =multi{i.j}; 问 i,j 和对应 output 的值,答案:
Answer
  • i j output 111 122 21 . 22 .
  • i j output 111 122 21. 22.

Question 80

Question
给定一个 data set 和 SQL 代码,问输出结果一致的是: 具体不记得了,摘一段类似的, 考点在 nodupkey,注意要 drop 掉一个 variable proc sort data=retail.order_fact out=work.sorted (drop=XXX) nodupkey; by order_date; run; 需要选有nodupkey, drop掉一个variable,而且by variable 不能有descending的, 因为SQL中的order by 默认是ascending的
Answer
  • True
  • False

Question 81

Question
data company.newdata / view=company.newdata; infile <fileref>; <DATA step statements> run; 以上代码 create a data step view 之后,要在 proc means 中使用 view,问应该用哪个代码: Submit the above code and create a data step view, then we need to use this view in the PROC MEANS procedure, which one to use:
Answer
  • A. proc means view= company.newdata;
  • B. proc means data=company.newdata / view=company.newdata;
  • C. proc means data company.newdata / view
  • D. proc means data=company.newdata

Question 82

Question
Pagesize info Which of proc can check the pagesize info?
Answer
  • A Proc Contents
  • B Proc print
  • C Proc report
  • D Proc catalog

Question 83

Question
Given two format with the same name $Gender, one store in Mylib, and the other in library. Proc print data=... ; run; Using the format $Gender. From the desired output, we can tell that the format in Mylib is used. Options fmtsearch=______________; Which statement should be filled in here?
Answer
  • A. no fmsearch needed
  • B. fmsearch=(mylib, library)
  • C. fmsearch=(library, mylib)
  • D. fmsearch=(mylib)

Question 84

Question
Horizontal join set operator (i) right join Two data sets Work.One year sales 2001 800 2001 500 2003 700 Work.Two year profit 2001 100 2002 200 proc sql; select sum(profit) from one right join two on one.year=two.year; quit; What is the output?
Answer
  • A. 100
  • B. 300
  • C. 400
  • D. 500

Question 85

Question
IDXNAME=... (instruct SAS to use a specific index for where processing) IDXWHERE sas里如何指定使用某一个index,用inxname 选inxname
Answer
  • True
  • False

Question 86

Question
It is about except operator, given two data sets, Ask about the output. Choose the answer with one
Answer
  • Answer: Charlie Omar
  • Answer: Charlie Omar

Question 87

Question
Given two data sets and SQL code, ask for the output.
Answer
  • Choose the answer with Thomas, Jones, Smith, but no Adam.
  • Besides, there is a descreasing option in the code, so the Sales need to be in decreasing order.

Question 88

Question
哪个个 view 的命名 code 正确?
Answer
  • data xxx/ view=xxx
  • (view 和 data set 的命名必须一样)

Question 89

Question
Efficiency of If-then/Else and Where clauses A compressed data set has 200,000 observations, 300 variables. We need 20% of character observations, What method can minimize computer resource usage?
Answer
  • A. If-then/Else clause
  • B. Case
  • C. Where
  • D. ...

Question 90

Question
Macro variable with macro trigger signs. Output title “RECENT A&M ACTIVITY”, which macro definition should be used.
Answer
  • A. title %sysfundc(“RECENT A&M ACTIVITY”)
  • B. title %str(“RECENT A&M ACTIVITY”);
  • C. title %nrstr(“RECENT A&M ACTIVITY”);
  • D. title %bquote(“RECENT A&M ACTIVITY);

Question 91

Question
Effect on SASFILE for repeating a local data set Repeated need a local data set, what kind of effect does SASFILE statement has to the Global statement.
Answer
  • A increase Network Bandwidth
  • B CPU increase
  • C I/O increase
  • D memory increase

Question 92

Question
left join and in-line view Product Product_id Product 1 1001 2 1002 3 1003 Sales Product_id Sales 3 100 1 200 5 100 1 200 3 100 1 100 Proc sql; Select p.product s.totalsales From product as p left join ( select sum(sales) as totalsales from sales as s) on p.product_id=s.product_id; quit; What is the output?
Answer
  • Product Totalsales 1001 500 1002 . 1003 200
  • Product Totalsales 1001 500 1002 . 1003 200

Question 93

Question
Work.temp is indexed
Answer
  • A Stops to executes as this is not in ascending order
  • B Stops to executes as this is not in descending order
  • C continue to executes without problem
  • D continue to executes but index=USE

Question 94

Question
in-line view 给了一段 code 明确告知 in-line view 中给定的 condition 有 multiply observations satisfied the condition, 问 program 运行结果。
Answer
  • 答案是运行出错没有结果
  • 因为 in-line view return multiple results

Question 95

Question
in-line view 给了一段 code 明确告知运行出错没有结果,问原因 given a failed program, ask the reason of failure. Proc sql; select Jobcode, Salary, (select avg(Salary) from WORK.PILOTS order by Jobcode) as Avg from WORK.PILOTS order by ID; quit;
Answer
  • Order By statement cannot be used inside of an in-line view.
  • There is another choice says that if using in-line view then we cannot use Order By statement. This is not true. The ORDER BY ID statement in the outside query is OK.

Question 96

Question
用 sql 生成多个宏变量 Proc sql...; select column1, column2 <insert code>;
Answer
  • into: c1varibale1-: c1varibale3 : c2varibale1-: c2varibale3
  • into: c1varibale1- c1varibale3 : c2varibale1- c2varibale3
  • into: c1varibale1: c1varibale2: c1varibale3 : c2varibale1: c2varibale2: c2varibale3
  • into : type1 -:type3 , :sale1- :sale3
  • INTO: shoesales1-: shoesales3, shoetype1-:shoetype3

Question 97

Question
展示数据库中两个数据集的名字、储存的行数和被删除的行数 问怎么在一个 library 里挑出删除了 5%以上 observation 的 dataset 选项太长了不记得具体的了,是考 dictionary table 的
Answer
  • select menname, nobs, delobs from dictionary.tables
  • select menname, nlobs, delobs from dictionary.tables
  • select menname, nobs, delobs from dictionary.members

Question 98

Question
multiple datasets 想用 set 和 key 合并的时候,应该应用在什么样的 dataset 上 (chapter 15) mergedataset时,什么时候用multipleSETstatement最有效率
Answer
  • A: dataset 都是 large,两个里面都有 index。
  • B: larger dataset,一个 smaller dataset,index in larger dataset
  • C: larger dataset,一个 smaller dataset,index in smaller dataset

Question 99

Question
考点: create index 时 unique 是已经确认的,不能被更改
Answer
  • create index 时 unique 是已经确认的
  • 不能被更改

Question 100

Question
引用 index 时,哪个效率高(题干和选项都没记清,仅提供考点) 在 index 很复杂的情况下,在 where statement 中选择怎样 index 最有效?
Answer
  • index include more rows
  • index unqualified more rows index that disqualify most variables
  • simple index
  • composite index

Question 101

Question
给了data set 和desired output,要求选code。 发现是要生成unique value of key variable.
Answer
  • 只有proc sort nodupkey; by var 的选项对
  • 有干扰选项proc sort nodup; by var;

Question 102

Question
什么样 characteristic 的 index can only be set up with DATASET procedure.
Answer
  • A: 关 于 index centiles 的,好像是 index centiles can be updated.
  • D:index 可以 包括 missing value
  • A. multiple variables;
  • B. unique key

Question 103

Question
要选出 inactive_date 为 missing 时候的 observation。题目是 prol sql; Select * From dataset1 A Full join dataset2 B On A.ID = B.ID Where inactive_date is missing; 问 data dataset3; merge dataset1 (In=Ina) dataset2 (In=Inb); By ID; <insert statement>;
Answer
  • A: where inactive_date is missing and (Ina and Inb)
  • B: where inactive_date is missing and (Ina or Inb)
  • C:想不起来了 好像是 if inactive_date is missing and (ina and inb)
  • D: If inactive_date ne .
Show full summary Hide full summary

Similar

GCSE PE - 2
lydia_ward
C4 - Formulae to learn
Tech Wilkinson
AS Unit 1 Physics Flashcard Deck
Callum McClintock
Physical Geography
littlegoulding
Historia de la Música
Alicia Maqueira Atienza
AQA AS Biology - Pathogens and Disease
dillyrules
GCSE Biology B1 (OCR)
Usman Rauf
The Circulatory System
Shane Buckley
CONCEPTUAL MAP
Andres Sanchez
Cells And Cell Techniques - Flashcards (AQA AS-Level Biology)
Henry Kitchen
TISSUE TYPES
Missi Shoup