楼主: aj_goodnews
1151 4

SAS programming question [推广有奖]

  • 2关注
  • 0粉丝

硕士生

43%

还不是VIP/贵宾

-

威望
0
论坛币
608 个
通用积分
2.8500
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
2531 点
帖子
107
精华
0
在线时间
211 小时
注册时间
2008-3-17
最后登录
2024-3-27

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

[size=12.800000190734863px]Hello I'm working on some project and need to count number of events between any of two event dates for each firm. I have data look like this:

                              event date                        firm cusip       number of event +/- 183 daysnumber of events +/-365 daysnumber of event +/- 548 days

1991/2/21

21

1992/3/24

21

1994/3/7

361

1997/6/10

361

1998/9/9

361

2000/1/11

361

2009/6/15

361

1996/8/2

375

1997/1/23

375

1998/3/24

375

1999/7/21

375

1999/8/26

375

1999/11/28

375

2000/1/13

375

2000/5/8

375

2000/6/15

375

2000/6/30

375

2000/7/4

375

2000/7/6

375

2000/9/25

375

2000/10/5

375

2000/10/16

375

2001/2/19

375

2004/4/1

375

2005/6/22

375

2005/12/20

375

2007/6/14

375

2008/4/16

375

2008/8/22

375

2008/10/23

375

2009/3/31

375

2009/12/10

375

2011/6/12

375

2011/8/1

375

2012/3/6

375

2013/5/7

375



[size=12.800000190734863px]For column named number of event +/- , I need to count, for the same firm, number of event dates within the range of [-183,+183], [-365,+365],[-548,+548] relative to the event date on the same row. So for example, for firm with cusip=21, there are 397 days between two event date, 1991/2/21 and 1992/3/24, so in the first row, there are 0 event within the range of [-183,+183] relative to 1991/2/21, but there are 1 event within the range of  [-365,+365], and 1 event within the range of [-548,+548]. In the second row, I need to count the number of event for the same firm within these three ranges relative to the date of 1992/3/24. I need to do the same for three firms. This is the first time I do this kind of counting staff and I tried several method but they do not work on all of the firms. Please help!!


二维码

扫码加我 拉你入群

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

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

关键词:Programming question Program Quest gram question between number events count

沙发
hello_fj 发表于 2014-7-31 16:26:03 |只看作者 |坛友微信交流群
能说清楚问题吗?不太明白你的表达

使用道具

藤椅
learsaas 发表于 2014-8-1 08:30:12 |只看作者 |坛友微信交流群
double set statments can finish your task

使用道具

板凳
sas9.4 发表于 2014-8-1 19:50:36 |只看作者 |坛友微信交流群
第一行还能看懂,第二行就不知道你要干嘛了

使用道具

报纸
learsaas 发表于 2014-8-1 21:34:22 |只看作者 |坛友微信交流群
感觉楼主描述的很清楚了,唯一句话可能是楼主的笔误:but there are 1 event within the range of  [-365,+365], and 这句话里面的1可能是0.误写成1了。

使用道具

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

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

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

GMT+8, 2024-4-25 09:42