%sysrput的誤用,我使用AIX 6.1與SAS 9.1.3
我在PC SAS 9.1
運行的程序,程序將rsubmit到UNIX。
現在,我轉換程序在AIX 6.1
被完全運行程序非常奇怪的失敗。
經過調查,這是由於%sysrput
這裏是程序的簡化版本:奇怪的錯誤是由於SAS
options mPrint mLogic symbolGen ;
%macro combine(startdate= , fullprefix=);
data _null_ ;
call symput('plength',compress(length(compress("&fullprefix."))));
run;
data _null_ ;
length balance 8. ;
balance= 1 + &plength.;
run;
%mEnd;
data _null_ ;
call symput('refdate', put(today(),date9.));
run;
%put &refdate.;
* -- If I forget to comment out the sysrput, the plength cannot be resolved -- ;
%sysrput refdate=&refdate.;
%put &refdate.;
%combine(startdate= "&refdate."d, fullprefix=a_filename_prefix);
(對不起,該措辭是沒有意義的,我只想做一個演示)
其實,在AIX,我不應該用%sysrput
我只是忘記它註釋掉。
但是,如果我忘記了這一點,那麼balance =語句中的plength宏變量將會出錯。這很奇怪。
來解決,只需註釋掉%sysrput是確定的。
但是,沒有人知道爲什麼%sysrput將在宏宏變量導致失敗?
阿爾文SIU
SYSRPUT在包含它時是否給出錯誤,或者它是否工作?第二個%是否放入&refdate?看起來正確(與第一個相同)? – Joe