gpt4 book ai didi

input - 避免SAS错误消息: "NOTE: Invalid argument to function INPUT"

转载 作者:行者123 更新时间:2023-12-05 00:43:58 28 4
gpt4 key购买 nike

有没有一种方法可以测试变量是否会使SAS中的INPUT转换过程失败?或者,是否可以避免生成的“NOTE:无效参数”消息?

data _null_;  
format test2 date9.;
input test ;
test2=INPUT(PUT(test,8.),yymmdd8.);
if _error_ =1 then do;
_error_=0;
test2=INPUT(PUT(test-1,8.),yymmdd8.);
end;
put test2=;
cards;
20270229
run;

最佳答案

只需包含“??”格式名称之前。您的示例已在下面进行了修改...

data null;
format test2 date9.;
input test ;
test2=INPUT(PUT(test,8.),?? yymmdd8.);
if error =1 then do;
error=0;
test2=INPUT(PUT(test-1,8.), ?? yymmdd8.);
end;
put test2=;
cards;
20270229
run;

关于input - 避免SAS错误消息: "NOTE: Invalid argument to function INPUT",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/562089/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com