BookmarkSubscribeRSS Feed
tramn
Calcite | Level 5

Greetings,

 

I have a data set, in which companies pay dividends in different months in different years. I'd like to create a sequence of quarter dividend for 18 years.

 

I plan to group the dividend in different months into quarter dividend first, then create quarter dividend sequencing for different years next. Will there be any different and better way to do it? And would you kindly help me on the SAS procedures and programming please?

 

Thank you.

 

Best regards,

 

Tilda N.

3 REPLIES 3
Astounding
PROC Star
If you have a dividend date, you can get the first date of the quarter easily:

Q_begins = intnx('quarter', dividend_date, 0);
PGStats
Opal | Level 21

You could go for something like:

 

proc sql;
create table want as
select 
    intnx("qtr", divDate, 0) as divQtr format=yyq.,
    sum((divAmount) as qtrDivAmount
from have
group by calculated divQtr;
quit;

where divDate is a SAS date.

PG
mkeintz
PROC Star

@tramn 

 

I think you want to aggregate dividends for all companies, by quarter, correct?  If so, what are your date variables?  I.e., are they sas date values?  Or possibly year and month variables?  Could you show a sample of what your sas data set currently contains?

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 694 views
  • 0 likes
  • 4 in conversation