楼主: gxa1
3189 13

[原创博文] 弱弱的问,日期型变量的具体数值(已解决,谢谢pobel) [推广有奖]

  • 2关注
  • 0粉丝

已卖:142份资源

副教授

47%

还不是VIP/贵宾

-

威望
0
论坛币
411 个
通用积分
8.3100
学术水平
3 点
热心指数
5 点
信用等级
3 点
经验
38065 点
帖子
358
精华
0
在线时间
1315 小时
注册时间
2009-3-27
最后登录
2024-8-13

楼主
gxa1 发表于 2010-6-10 15:55:02 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
我在写程序的时候,用到if date=2004-06-01 then delete;总是过不去,2004-06-01是原数据集里的值呀,而且看看看date变量是数值型呀,为什么过不去?

非常感谢pobel及各位的回答,大家SAS都越学越好!
二维码

扫码加我 拉你入群

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

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

关键词:pobel 日期型 POB Obe 已解决 程序 而且

沙发
dfggffgdf 发表于 2010-6-10 15:57:12
提示: 作者被禁止或删除 内容自动屏蔽

藤椅
醉_清风 发表于 2010-6-10 16:09:04
if date=16223 then delete;
从来不需要想起 永远也不会忘记

板凳
醉_清风 发表于 2010-6-10 16:11:05
你看到的2004-06-01 是format后的效果 其真是值为16223
从来不需要想起 永远也不会忘记

报纸
pobel 在职认证  发表于 2010-6-10 16:15:54
if date=2004-06-01 then delete;
相当于 if date=1997 then delete;

地板
pobel 在职认证  发表于 2010-6-10 16:16:39
可以用 if date="01Jun2004"d then delete;

7
醉_清风 发表于 2010-6-10 16:23:57
pobel 发表于 2010-6-10 16:15
if date=2004-06-01 then delete;
相当于 if date=1997 then delete;
日期2004-06-01 的值是1997?
从来不需要想起 永远也不会忘记

8
pobel 在职认证  发表于 2010-6-10 16:42:48
醉_清风 发表于 2010-6-10 16:23
pobel 发表于 2010-6-10 16:15
if date=2004-06-01 then delete;
相当于 if date=1997 then delete;
日期2004-06-01 的值是1997?
2004-6-1=1998-1=1997

9
pobel 在职认证  发表于 2010-6-10 16:44:21
97   data x;
98       x=1997;
99       if x=2004-06-01 then put "This is right!";
100  run;

This is right!
NOTE: The data set WORK.X has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.01 seconds

10
pobel 在职认证  发表于 2010-6-10 16:45:40
醉_清风 发表于 2010-6-10 16:23
pobel 发表于 2010-6-10 16:15
if date=2004-06-01 then delete;
相当于 if date=1997 then delete;
日期2004-06-01 的值是1997?
不是日期的值相当于1997,是那个if语句相当于比较date和1997

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

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