Converting character variabls to numeric in SAS

纵然是瞬间 提交于 2019-12-24 14:55:02

问题


I am creating a numeric version of a character variable in SAS. I am using the best32. numeric format along with an input statement, as I do not want to lose any data.

Below is an example that in which SAS is dropping data and I am unclear as to why.

   DATA trial;
X='1264263.336532';
Y=INPUT(X,BEST32.);
PUT Y;
RUN;

Y is only 1264263.3365 and not X. I am unsure why this is happening.


回答1:


SAS is displaying the number in the default BEST12. format. Try PUT Y best32.; instead



来源:https://stackoverflow.com/questions/19984573/converting-character-variabls-to-numeric-in-sas

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!