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

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

sas-innovate-2024.png

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

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.

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
  • 547 views
  • 0 likes
  • 4 in conversation