楼主: windrococoyu
1343 1

[程序分享] sas求助informat日期变量,求高手指点 [推广有奖]

  • 0关注
  • 0粉丝

硕士生

98%

还不是VIP/贵宾

-

威望
0
论坛币
285 个
通用积分
0.0000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1757 点
帖子
97
精华
0
在线时间
313 小时
注册时间
2008-9-26
最后登录
2025-9-15

楼主
windrococoyu 发表于 2017-8-7 09:26:46 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
data CHNDATA;
input date  IMEXSUM        KOREER        FINANCESAVING        CHNREER        GOVERNINCOME        GOVERNEXPEND        ENTERPROFIT        GDPQUARTERLY        DOMESTICONSU        STOCKVALUE;
informat date yymm5.;
format date yymm5.;

lnimex=log(IMEXSUM);
lncnreer=log(CHNREER);
lnfs=log(financesaving);
lngi=log(governincome);
lnge=log(governexpend);
lnep=log(enterprofit);
lngq=log(gdpquarterly);
lndc=log(domesticonsu);
lnsk=log(stockvalue);
cards;
19951        548.53        120.26        111727.52        75.11        1027.4        1029.11        4660.1        12111.7        4660.1        3806.08
19952        715.84        119.24        120203.5        74.86        1484.78        1484.3        4783.8        14612.9        4783.8        3694.47
程序运行后如下:data CHNDATA;
924  input date  IMEXSUM KOREER  FINANCESAVING   CHNREER GOVERNINCOME    GOVERNEXPEND    ENTERPROFIT
924! GDPQUARTERLY    DOMESTICONSU    STOCKVALUE;
925  informat date yymm5.;
                   ------
                   48
ERROR 48-59: The informat YYMM was not found or could not be loaded.

926  format date yymm5.;
927
928  lnimex=log(IMEXSUM);
929  lncnreer=log(CHNREER);
930  lnfs=log(financesaving);
931  lngi=log(governincome);
932  lnge=log(governexpend);
933  lnep=log(enterprofit);
934  lngq=log(gdpquarterly);
935  lndc=log(domesticonsu);
936  lnsk=log(stockvalue);
937  cards;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.CHNDATA may be incomplete.  When this step was stopped there were 0
         observations and 20 variables.
WARNING: Data set WORK.CHNDATA was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

1027  ; RUN;
为什么时间格式输入不对呀?


二维码

扫码加我 拉你入群

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

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

关键词:高手求助 万分感谢

沙发
popodan 在职认证  发表于 2017-8-7 10:12:01 来自手机

The YYMMw. format writes SAS date values in the form <yy>yyMmm, where
<yy>yy
is a two-digit or four-digit integer that represents the year.

M
is the character separator to indicate that the number of the month follows..

mm
is an integer that represents the month.

所以你要用yymm5.来表示1995年一月,应该是95M01。


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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-30 04:31