BookmarkSubscribeRSS Feed
Calcite | Level 5



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.

Opal | Level 21
If you have a dividend date, you can get the first date of the quarter easily:

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

You could go for something like:


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

where divDate is a SAS date.

Jade | Level 19



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




Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 4 in conversation