[英]Variable value as title in sas ods
我有一個數據集,其中變量的值如下所示Diagosis 780.7 804.7 101.7通過ods和proc報告,我希望將此值作為工作表的標題,如下所示:
診斷* 780.7 * 804.7 * 101.7
誰能給我一個想法,如何通過ods將可變值作為Excel表中的標題拋出。
這取決於您的數據外觀。 讓我們將您的特殊值稱為value
並假設它是字符格式。 該特殊值位於變量列中,我們將其稱為Var1
。 你把if語句如下
data _null_;
set yourdata;
if Var1 = "value" then /* if "Var1" is equal to "value" then */
call symput ('value1',Var1); /* create a Macro variable with call symput*/
run; /* Now you can use this &value1 anywhere in your code */
ods listing close;
ods tagsets.excelxp file="&path\yourfile.xls" style=statistical
options(sheet_name='&value1.*'); /* If you want to add a character into the sheet name,
then you can write &value.* as there is a dot between them */
;
proc print data=yourdata; run;
ods tagsets.excelxp close;
ods listing;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.