SAS 在标题中使用宏

SAS using macro in a title

这里标题标题“&TitleX”的用途是什么?

第一种方式和第二种方式有区别吗?


%let TitleX=PROC PRINT Of Only &Cyl_Count Cylinder Vehicles; %let Cyl_Count=5;
Title "&TitleX";
proc print data=sashelp.cars;
where Cylinders=&Cyl_Count;
var Type Make Model Cylinders MSRP; run;


title PROC PRINT Of Only &Cyl_Count Cylinder Vehicles; %let Cyl_Count=5;
proc print data=sashelp.cars;
where Cylinders=&Cyl_Count;
var Type Make Model Cylinders MSRP; run;

有两个区别。一个是宏变量存在并且可以根据需要用于其他用途。第二个是 TITLE 语句是如何生成的。使用 TITLEX 宏变量的版本使用引号,而另一个不使用引号,但这实际上与宏变量没有任何关系。