b****u 发帖数: 67 | 1 1. 请问b为啥不对呀 ?? 谢谢
%macro printdsn(dsn,vars);
%if &vars= %then %do;
proc print data=&dsn;
title "Full Listing of %upcase(&dsn) data set";
run;
%end;
%else %do;
proc print data=&dsn;
var &vars;
title "Listing of %upcase(&dsn) data set";
run;
%end;
%mend;
a. %printdsn(sasuser.courses, course_title days);
b. %printdsn(dsn=sasuser.courses, vars=course_title days)
c. %printdsn(sasuser.courses, course_title days)
d. %printdsn(sasuser.courses, course_title, days)
Correct answer: c
Your answer: b
2. data _null_;
set sasuser.courses;
call symput('class', course_title);
run;
variable class是local 还是global ne ?
Thanks !! | d******9 发帖数: 404 | 2 1.If you want to use keyword macro parameters, you need declare them in the
macro definition first.
However, the definition here:
%macro printdsn(dsn,vars);
is not correct, it define the positional parameters.
If you want to use b, then you should define macro like this:
%macro printdsn(dsn=,vars=);
2. data _null_;
set sasuser.courses;
call symput('class', course_title);
run;
variable class是local 还是global ne ?
it is global, because it is defined in open code. | b****u 发帖数: 67 | |
|