t*****w 发帖数: 254 | 1 I have not understood the following question meaning yet.
what does "inside" or "outside" in %put statement mean?
Item 62 of 63 Mark item for review
Given the following macro program
and invocation:
%macro MAKEPGM(NEWNAME, SETNAME);
data &NEWNAME;
set &SETNAME;
run;
%put ---> inside macro &NEWNAME &SETNAME;
%mend;
%MAKEPGM(WORK.NEW, SASHELP.CLASS)
%put ---> outside macro &NEWNAME &SETNAME;
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.
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 |
s****u 发帖数: 1200 | 2 To retrieve the macro value within and outside the macro.
★ 发自iPhone App: ChineseWeb 7.8
【在 t*****w 的大作中提到】 : I have not understood the following question meaning yet. : what does "inside" or "outside" in %put statement mean? : Item 62 of 63 Mark item for review : Given the following macro program : and invocation: : %macro MAKEPGM(NEWNAME, SETNAME); : data &NEWNAME; : set &SETNAME; : run; : %put ---> inside macro &NEWNAME &SETNAME;
|
t*****w 发帖数: 254 | 3 you mean that outside macro is to make the macro variable global?
【在 s****u 的大作中提到】 : To retrieve the macro value within and outside the macro. : : ★ 发自iPhone App: ChineseWeb 7.8
|
s*****d 发帖数: 267 | 4 To global a variable, you have to use %global to declare it.
Example:
%global var1;
%let var1=10;
%macro dummytest();
%put var1=&var1; /* should be 10 */
%let var1=11;
%mend;
%put var1=&var1; /* should be 11 now */
Hope this can help u.
请发包子
【在 t*****w 的大作中提到】 : you mean that outside macro is to make the macro variable global?
|