BookmarkSubscribeRSS Feed
JNK1
Calcite | Level 5

Hi all,

I am trying to filter down a list of all listed US companies and their dividend payouts over 10 years, to a list of all listed US companies which have at least one dividend payout over the 10 year period.

I have managed to filter out any companies which do not operate over the full 10 years by doing the following;

PROC SQL;

CREATE TABLE DDM AS

SELECT LPERMNO, datadate, fyear, csho, dvc, ni

FROM work.data

GROUP BY 1

HAVING COUNT(*)=12;

QUIT;

Which took me long enough in itself, yet this list is not all that I require as the companies must also be paying dividends.

Is there a way of filtering the data subject to the above, but also subject to the criteria that AT LEAST 1 'dvc' is > 0 for each LPERMNO (Company)?

I do not want to get rid of all LPERMNO's which have a 'dvc' = 0, just the LPERMNO's where no 'dvc's exist.

Please let me know if more clarification is required.

2 REPLIES 2
art297
Opal | Level 21

If you want companies for which you have at least ten years data, why do you select where count(*)=10?

I would think that you'd want count(*) ge 10 and max(dvc) gt 0

JNK1
Calcite | Level 5

Sorry, my data has already been collected and filtered to be from December 1997 to December 2008, hence why there are 12 observations per company (LPERMNO).

max(dvc) GT 0 did the trick though, thank you so much for your help!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2 replies
  • 937 views
  • 0 likes
  • 2 in conversation