在嘗試啓動並運行DS2線程時出現奇怪的錯誤代碼。SAS proc ds2 YEAR功能
proc ds2;
thread work.th_ieb /overwrite=yes;
dcl DOUBLE Beg_Jahr;
METHOD RUN();
set {select id, date
from DATA
};
IF FIRST.id THEN DO;
Beg_Jahr = YEAR(DATE);
OUTPUT;
END;
END;
endthread;
run;
的錯誤是:
ERROR: Compilation error.
ERROR: Illegal conversion for date or time type. Source line 34.
它工作正常,沒有YEAR的功能。有任何想法嗎?
請確保與您稱爲'date'的變量關聯的類型實際上具有日期類型。在'PROC DS2'中,實際上有一個日期數據類型,與「傳統」SAS不同,日期存儲爲自1960年1月1日以來的天數。 – 2014-11-26 15:20:46
即使添加'dcl DATE date',它也不會運行。 – user3614882 2014-11-27 16:09:53