全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
985 1
2013-08-04
1。
这个程序跑出来为什么只有一个观测?我是用Notepad,datalines和cards不算
124325   08/10/2003     1250.03
7             08/11/2003     12500.02
114565   08/11/2003     5.11

filename transact 'C:\BBU FORMAT\DATA\TRANS1.DAT';
data transact;
infile transact;
input @1 id $6.
@10 tran_date mmddyy10.
@25 amount 8.2
;
amount=1;
tran_date=2;
id=1;
run;
proc print data=transact;
run;

2. 还是上一个程序,书上说
Note that the Tran_Date variable is now in
terms of SAS date values representing the number of days since the first day of the
year specified in the YEARCUTOFF option (for this run, yearcutoff=1920).
我怎么感觉是从1960算起啊? 15000多天
二维码

扫码加我 拉你入群

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

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

全部回复
2013-8-5 08:57:26
错误的原因是 amount 的 informat 8.2 要读 8 位数字, 而数据不到 8位.

把   @25 amount 8.2     
改成 @25 amount     或 @25 amount : 8.2

yearcutoff= 设定的是怎样用两位数来表示四位数的年份,而不是日期变量的起始点。 日期变量的起始点是 1960-01-01.
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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