在SAS中将字符变量转换为数字 [英] Converting character variabls to numeric in SAS

查看:159
本文介绍了在SAS中将字符变量转换为数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 SAS 中创建字符变量的数字版本.我正在使用best32.数字格式以及输入语句,因为我不想丢失任何数据.

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.

以下是 SAS 丢弃数据的示例,我不清楚原因.

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 只是 1264263.3365 而不是 X.我不确定为什么会这样.

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

推荐答案

SAS 在默认的 BEST12 中显示数字.格式.尝试 PUT Y best32.;而是

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

这篇关于在SAS中将字符变量转换为数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆