考慮以下幾點:爲什麼MAX函數去掉proc sql中的SAS變量格式?
data;
format x datetime19.;
x=datetime();
flag='FIRST';
do x=datetime() to x+10 by 1;
output;
flag='';
end;
proc sql noprint;
select x into : test1 from &syslast where flag='FIRST';
select max(x) into: test2 from &syslast;
%put now we see that &test1 is in a different format to &test2;
data _null_; set;
put x=; /* formatted */
call symput('test3',x);
call symput('test4',max(x,sum(x+1000)));
stop;
run;
%put The data step is more consistent - &test3 = &test4;
似乎不一致給我。爲什麼proc sql在這種情況下保留格式?此行爲是否記錄在案?
此外 - 你可以修改理查德宏(http://www.devenezia.com/downloads/sas/macros/index.php?m=samelabl)將格式從一個數據集複製到另一個數據集。 –
功能 - 有道理。解釋數據步驟結果(symput函數) –