는 다음과 같은 고려 :왜 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 함수). –