楼主: charleszhong28
1370 2

初学者的一个问题? [推广有奖]

  • 0关注
  • 0粉丝

大专生

73%

还不是VIP/贵宾

-

威望
0
论坛币
292 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
5244 点
帖子
10
精华
0
在线时间
113 小时
注册时间
2009-11-19
最后登录
2010-4-8

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
俺是初学者, 请教下面的三段DATA步,为什么YY,YY1和YY2的值不一样?

data tem;
input xx 6.1;
input yy 6.1;
cards;
2.12E4
7200000
;
run;

data tem1;
input xx1 6.1 yy1 6.1;
cards;
2.12E4 7200000
;
run;

data tem2;
input xx2 6.1 yy2 :6.1;
cards;
2.12E4 7200000
;
run;

执行后TEM中YY的值为72000,TEM1的YY1为7200 ,TEM2中的YY2为72000 ??

多谢了!
二维码

扫码加我 拉你入群

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

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

关键词:初学者 Input cards data步 Data 初学者

回帖推荐

bobguy 发表于2楼  查看完整内容

In your case YY2 should be 720000 instead of 72000. The correct one is 7200000. It can be very tricky when one reads raw data with informats in the input statement. It implies some assumptions by informats besides informat instructions 1) variable type 2) variable length if char vars 3) position or point 4) the colon (:) modiflier will provide additional instructions Look SAS onl ...

本帖被以下文库推荐

沙发
bobguy 发表于 2009-11-30 00:48:16 |只看作者 |坛友微信交流群
charleszhong28 发表于 2009-11-29 06:57
俺是初学者, 请教下面的三段DATA步,为什么YY,YY1和YY2的值不一样?

data tem;
input xx 6.1;
input yy 6.1;
cards;
2.12E4
7200000
;
run;

data tem1;
input xx1 6.1 yy1 6.1;
cards;
2.12E4 7200000
;
run;

data tem2;
input xx2 6.1 yy2 :6.1;
cards;
2.12E4 7200000
;
run;

执行后TEM中YY的值为72000,TEM1的YY1为7200 ,TEM2中的YY2为72000 ??

多谢了!
In your case YY2 should be 720000 instead of 72000. The correct one is 7200000.

It can be very tricky when one reads raw data with informats in the input statement.

It implies some assumptions by informats besides informat instructions
1) variable type
2) variable length if char vars
3) position or point
4) the colon (:) modiflier will provide additional instructions

Look SAS online help or documentation.
HTH

Is it a homework assignment?
已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 3 精彩帖子

总评分: 经验 + 3  论坛币 + 3   查看全部评分

使用道具

藤椅
charleszhong28 发表于 2009-11-30 05:31:08 |只看作者 |坛友微信交流群
bobguy 发表于 2009-11-30 00:48


In your case YY2 should be 720000 instead of 72000. The correct one is 7200000.
.....

Is it a homework assignment?
You are right,I made mistake. YY2 is 720000.

I don't care which one is correct or not. I am concern that why those sentences have difference results?

It's a homework doing by myself.

Thanks a lot.

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-28 04:59