全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2195 2
2018-09-02
问个小白的问题
data;
informat x 8.2;
x=12345.1234;
put x=;
run;

结果为啥是x=12345.1234?format x 8.2不起作用么?还是与format的在里面顺序有关系?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2018-9-2 19:34:57
The Basics
An INFORMAT statement in a DATA step permanently associates an informat with a variable. You can specify standard SAS informats or user-written informats, previously defined in PROC FORMAT. A single INFORMAT statement can associate the same informat with several variables, or it can associate different informats with different variables. If a variable appears in multiple INFORMAT statements, SAS uses the informat that is assigned last.
复制代码
你把informat x 8.2; 放在 x=12345.1234;之后,就是12345.12了。
或者直接使用format  x 8.2语句。
附件列表
捕获1.PNG

原图尺寸 11.45 KB

捕获1.PNG

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2018-9-3 09:35:57
superguy333 发表于 2018-9-2 19:34
The Basics
An INFORMAT statement in a DATA step permanently associates an informat with a variable. ...
谢啦
这是出自哪本书呀?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群