0
我遇到問題,do循環創建我的報告,但是列出宏的標題頁並不反映每次正確的命名約定。 它適用於PDF中的每個書籤以及proc報告本身。然而標題沒有正確反映。SAS Proc報告標題錯誤
%macro PDF_T2(year=, age=);
proc sql noprint;
select distinct region, bh_type
into :region1 - :region14, :bh_type1 - :bh_type14
from table2_IP
;
quit;
/*%put ®ion1 ®ion2;*/
/*%put &bh_type1 &bh_type2;*/
ods escapechar '^';
ods pdf file="C:\PDFS\Table2.pdf" pdftoc=2 style=Custom;
options orientation=landscape missing=' '
topmargin=.25in
bottommargin=.25in
leftmargin=.25in rightmargin=.25in ;
ods proclabel " Inpatient Analysis By Plan ";
%do i=1 %to 4;
TITLE "^{style [JUST= C ]Table 2. Inpatient Utilization By Plan,}";
TITLE2 "^{style [JUST= C ]&®ion&i. }" ;
Title3 "^{style [JUST= C ]Adult (21 to 64)}";
Title4 "^{style [JUST= C ]&&bh_type&i. Analysis}" ;
PROC REPORT DATA = Table2_IP contents="&&bh_type&i. Table: Inpatient`enter code here`
什麼頭銜你得到的,它們是怎樣被錯? – Quentin
我最終得到的通常是最後一個循環,而不是正確的時間段= t1。因此,對於T1,&& BH_TYPE或&& REGION將指示t2等。就好像標題在重新提交循環之前沒有自行清除一樣。 – Tinkinc
確保在PROC REPORT步驟結束時添加一個'RUN;'語句。否則,只有在看到下一步邊界時報表纔會啓動。這通常是下一次循環中的「PROC REPORT」步驟。屆時標題已經被更改爲下一個循環實例的值。 – Tom