全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2027 4
2010-12-23
悬赏 30 个论坛币 已解决
I have the following data set A with variable Mon (format: MONYY5.)

Mon
JAN10
FEB10
MAR10
APR10
MAY10

I want to get only records that after MAR10, but how can i use the GT in the code?

Data B;
Set A;
Where Mon GT 'MAR10'D.;------i KNOW its wrong, but I dont know how to do it right....
RUN;

最佳答案

elek.me 查看完整内容

Hello. rockfido. MONYY5. is an useful INFORMAT. You can use this INFORMAT and INPUT function to convert a character into a date value. The following is one of the solutions to your question. Hope it helps.
二维码

扫码加我 拉你入群

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

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

全部回复
2010-12-23 11:05:33

Hello.  rockfido.
MONYY5. is an useful INFORMAT.  You can use this INFORMAT and INPUT function to convert a character into a date value.  The following is one of the solutions to your question.
Hope it helps.

复制代码

二维码

扫码加我 拉你入群

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

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

2010-12-23 13:09:02
Data B;
Set A;
Where mon GT '31MAR10'D;
RUN;
二维码

扫码加我 拉你入群

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

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

2010-12-23 14:01:56
不知道怎么删自己的贴。 囧。
二维码

扫码加我 拉你入群

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

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

2010-12-24 10:17:38
HI,try this code .
it works if the day  i added into doesn't make any difference
data test;
input mon monyy5.;
cards;
JAN10
FEB10
MAR10
APR10
MAY10
;
data b;
set test;
if mon >'01MAR10'd;
run;
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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