我是SAS的新手。如何在今天之前的SAS中創建30天的日曆表?
我想在SAS中創建一個簡單的表格,它包含三列,日期(對於今天的三十天prir),how_many_days_before(表示日期和今天之間的天數)以及which_day(顯示名稱日期爲星期一,星期二等)。
編輯:這是我試過的代碼。我想用循環自動化宏。此外,輸出表的空白值現在爲which_day和how_many_days_before變量。
%macro which_day;
if date=160822 then which_day='monday';
else if date=160821 then which_day='sunday';
%mend;
%macro how_many_days_before;
if date=160822 then how_many_days_before=0;
else if date=160821 then how_many_days_before=1;
%mend;
data calendar;
attrib date format=yymmdd6.;
do date=today()-30 to today();
output;
end;
%which_day;
%how_many_days_before;
run;
我已經嘗試過沒有運氣的intnx函數。
感謝
請發佈您試過的代碼,以便我們可以看到您遇到問題的位置。 StackOverflow上的人員很樂意幫助解決問題,但不是代碼編寫服務。 –
根據您的問題,您的圖像不會通知您正在嘗試做什麼。 – Reeza
你好,羅伯特和雷薩,你說得對,我很抱歉。原諒我,因爲這是我的第一篇文章。 – Secil