标题: SAS Advanced Programming exam [打印本页] 作者: shiyiming 时间: 2008-7-15 11:15 标题: SAS Advanced Programming exam I just passed the SAS advanced programming exam last Saturday. Here are few things that I can share with everyone. Following are few exam questions I can only remember. They are not in the sample questions, which I got from this forum. Some descriptions of questions and options might not exactly be the same as the actual ones, but at least you guys can gain some idea.
1. In which situation, SELECT is more efficient than IF/THEN ELSE?
A. In the small amount selected data which is randomly distributed for numeric variables.
B. In the small amount selected data which is uniformly distributed for numeric variables.
C. In the large amount selected data which is randomly distributed for character variables.
D. In the large amount selected data which is uniformly distributed for character variables.
2. %LET VAR= WONDERFUL;
%LET SAS= VAR
%PUT <INSERT A SAS STATEMENT HERE>
The %PUT statement generates "WONDERFUL" in the log, which following code is used for that?
A. "&&&SAS"
B. """&&&SAS""
C. (I forget this one)
D. %QUOTE(&&&SAS)
3. %MACRO LOOP1 (INPUT);
%LOOP2;
%PUT DATE IS &DATE;
%MEND;
A. DATE IS 31DEC2006 read from global symbol table.
B. DATE IS 28SEP1998 read from local symbol table of LOOP1
C. DATE IS 28SEP1998 read from local symbol table of LOOP2
D. DATE IS 28SEP1998 read from global symbol table.
(There was another question which was almost the same as this one, but the location of %PUT was different.)
(Therefore, we can see that understanding the global and local symbol tables are really important.)
4. sasuser.data contains variables FMTNAME, START, LABEL. What does the following statement do?
PROC FORMAT CNTLIN=sasuser.data
RUN;
(I can barely remembere the options.)
5. %MACRO LOOP1;
hight weight;
%MEND;
%MACRO LOOP2;
age race;
%MEND;
Which one in the following options can correctly generate a report?
A. PROC PRINT DATA=sasuser.data;
VAR %LOOP1 %LOOP2;
RUN;
B. PROC PRINT DATA=sasuser.data;
VAR %LOOP1 age;
RUN;
C. PROC PRINT DATA=sasuser.data;
VAR age %LOOP1;
RUN;
D. PROC PRINT DATA=sasuser.data;
VAR %LOOP1 %LOOP2 height;
RUN;
GROUPFORMAT, NOTSORTED, HASH OBJECT, the purpose of using SASFILE are also in the exam.
Don't even mention how important the different joins and vertical table combination techniques in PROC SQL are.
Many exam questions are the same as those in the sample questions.
I hope you find these pieces of information helpful, and good luck to anyone who is preparing for the test.作者: shiyiming 时间: 2008-10-2 22:48 标题: Re: SAS Advanced Programming exam It would be more helpful if you can share your experience in preparing for the exam, like which book you read作者: shiyiming 时间: 2008-10-15 02:49 标题: Re: SAS Advanced Programming exam I wish I had seen this post earlier.
#3 is really tricky to me, the complete program should be
/*
%MACRO LOOP1 (INPUT);
%LOOP2;
%PUT DATE IS &DATE;
%MEND;
%MACRO LOOP2;
DATA _NULL_;
CALL SYMPUT('DATE', '28SEP1998');
RUN;
%MEND;
%LET DATE=31DEC2006;
%LOOP1(&DATE)
*/
The point is that macro symbols created by CALL SYMPUT will be global if the local symbol table does not exist. That's the only exception because macro symbols generated (w/ new names) otherwise (within a macro) are all local.
Also, when a symbol name is already used in a global statement or within a macro of higher level, then the %let, call symput, select ... into ... statements will reference the existing symbol instead of creating a new local symbol! Only the %local statement and parameters always put symbols into local symbol table!
I missed this one, so another 3 or 4 similar questions popped up later for me. This is outrageous! Thought I was pretty good at macro?!
As a result, I finished only 13 out of the 19 questions for macro, 19 out of 20 for sql, and 26 out of 26 for the rest. Some other tricky ones:
/*
#1
%let one=two;
%let two=three;
%let three=last;
what does &&&&&one resolve to?
A. one
B. two
C. three
D. last
#2
%macro doit();
data _null_;
<missing statement>
run;
%mend;
%doit;
which statement can replace the missing statement and create a global symbol?
A. CALL SYMPUT('x', 2);
B. CALL SYMPUT(2, 'x');
C. CALL SYMPUT('x', 2, 'G');
D. CALL SYMPUT(2, 'x', 'G');
#3 (not exact, just something similar to the following, there're only 2 distinct values for sex)
%macro doit();
proc sql noprint;
%let n=19;
select distinct sex into :sex1-:sex&n from sashelp.class;
%do i=1 %to &n;
proc print data=sashelp.class;
where sex="&&sex&i";
run;
%end;
%mend;
%end;
%doit
How many reports will be produced?
A. 0
B. 1
C. 2
D. 19
#4 (not exact)
%let word = blahblah;
how to display "blahblah" in a title?
A. "&word"
B. '"'&word'"'
C. ""&word""
D. "%quote(&word)"
This question itself is confusing. I had thought blahblah needs to be double quoted in the title and found no answer is appropriate. But now I think double quotes need not to be displayed.
*/作者: shiyiming 时间: 2008-10-17 07:22 标题: Re: SAS Advanced Programming exam Thank you very much!作者: shiyiming 时间: 2008-11-7 06:19 标题: Re: SAS Advanced Programming exam thanks for sharing, i'll take adv exam soon.作者: shiyiming 时间: 2008-11-19 23:48 标题: Re: SAS Advanced Programming exam it's very help.
Work hard!