2017-02-09 67 views
0

我發現如果我想在標題後的第day1列上色,我必須添加'RowNum + 1;'。沒有這個,如果我更改數字,我的代碼將無法工作。有人能告訴我爲什麼嗎?非常感謝你!爲什麼在proc報告中使用RowNum + 1

proc report data=final_report15 nowindows split='*' 
style(header)={foreground=white}; 
column category Work_types2 tot_act day0 day1 day2 day3 day4 day5_9 day_11 ph tot_pend day0_p day1_p day2_p day3_p day4_p; 
define category/'#' style(header)=[background=grey]; 
define Work_types2/'Work types' style(header)=[background=grey]; 
define tot_act/'# in active*queue' style(header)=[background=Deepskyblue]; 
define day0/'Day 0' style(header)=[background=Deepskyblue]; 
define day1/'Day 1' style(header)=[background=Deepskyblue]; 
define day2/'Day 2' style(header)=[background=Deepskyblue]; 
define day3/'Day 3' style(header)=[background=Deepskyblue]; 
define day4/'Day 4' style(header)=[background=Deepskyblue]; 
define day5_9/'Day 5-10' style(header)=[background=Deepskyblue]; 
define day_11/'Day 11+' style(header)=[background=Deepskyblue]; 
define ph/' ' style(header)=[background=Black]; 
define tot_pend/'Pending Total' style(header)=[background=orange]; 
define day0_p/'Day 0' style(header)=[background=orange]; 
define day1_p/'Day 1' style(header)=[background=orange]; 
define day2_p/'Day 2' style(header)=[background=orange]; 
define day3_p/'Day 3' style(header)=[background=orange]; 
define day4_p/'Day 4' style(header)=[background=orange]; 
title "Pend Queue Report - Wipro"; 
compute day1; 
RowNum+1; 
if ((RowNum>=2 and RowNum<=7) or (RowNum>=9 and RowNum<=10) or (RowNum>=12 and RowNum<=13) or (RowNum>=15 and RowNum<=18) or (RowNum>=20 and RowNum<=31)) then do; 
call define(_col_,'style','style=[background=yellowgreen]'); 
end; 
endcomp; 
if ((RowNum>=2 and RowNum<=7) or (RowNum>=9 and RowNum<=10) or (RowNum=12) or (RowNum>=15 and RowNum<=18) or (RowNum>=20 and RowNum<=25) or (RowNum>=27 and RowNum<=31)) then do; 
call define(_col_,'style','style=[background=yellowgreen]'); 
end; 
if (RowNum=13 or RowNum=26) then do; 
call define(_col_,'style','style=[background=gold]'); 
end; 
endcomp; 
run; 

回答

2

你沒有告訴我們足夠的代碼就知道肯定,但ROWNUM是不是一個關鍵的詞,它是一個變量的名稱(可能是存在於輸入數據的變量,或者你可以在計算塊中創建變量)。

我期望在你的代碼中,RowNum+1;正在創建RowNum變量(並且每次語句執行時增加它)。

+0

謝謝你的回答。實際上它不是輸入數據中存在的變量。 – Sylvia

+0

我已粘貼完整的代碼。 – Sylvia