BookmarkSubscribeRSS Feed
totomkos
Calcite | Level 5

I work on creating and omission sample with some restrictions in order to replicate a paper for my research. the paper i am trying to replicate mentions that "Using CRSP data on dividend payment history, a potential dividend omission is identified when a firm has not paid a dividend within 1 quarter, 6 months or 1 year from the previous payment if the firm pays quarterly, semi-annual or annual

dividends respectively. In this identification, we allow for "late" payments and define a 3-year period to consist of 1128 days or approximately 31 days in a month. For example if i had the following obseravtions and variables how do i add the restriction i mentioned above ( based on the restrction this is not an omission event as the last declaration is in the 3 -year perion

permno  dclrdt

10006    19620803

10006    19620315

10006    19621102

10006    19630802

10006    19650406

In a previous discussion somenone suggest a variable that find the last year of declarations and keep this observation as omission. tha code i used is the following

ata test5;

set test4;

  yeardclrdt= year (DCLRDT);

run;

data potomit;

    set test5 (keep = permno dclrdt distcd  yeardclrdt);

run;

proc sql;

create table want3 as

select *,

          case when (select count(yeardclrdt) from potomit as b where b.yeardclrdt=a.yeardclrdt+1 and b.PERMNO=a.PERMNO) gt 0 then 0 else 1 end as omission

           

  from potomit as a

   order by PERMNO,yeardclrdt ;

quit;

data want3;

set want3;

by PERMNO yeardclrdt ;

if not last.yeardclrdt then omission=0;

run;

19 REPLIES 19
art297
Opal | Level 21

Do you want to identify firms that have a 3 year or greater period without dividend, or just the records where it occurs?  If it is the latter, and if your data are already sorted by permno and dclrdt, then you might only need something like:

data test4;

  informat dclrdt yymmdd8.;

  format dclrdt date9.;

  input permno  dclrdt;

  cards;

10006    19620803

10006    19620315

10006    19621102

10006    19630802

10006    19650406

10006    19680406

;

data want;

  set test4;

  by permno;

  lastdclrdt=lag(dclrdt);

  if first.permno then call missing(lastdclrdt);

  span=intck('year',lastdclrdt,dclrdt,'C');

run;

totomkos
Calcite | Level 5

Actually ,i want to identify firms that omit dividends either by stop paying for a long long period (maybe they never pay again) or firms that used to pay dividends (quarterly, annually, or semiannually)  and the stop paying dividends for a period and afterthat the start again. The last case is the what i described in my example

10006    19620803

10006    19620315

10006    19621102

10006    19630802

10006    19650406

10006    19680406

and by the definition of the restriction i have to exclude it from omision sample, but with the code i wrote above i did not.

thank you in advance

art297
Opal | Level 21

Not sure I understand the criteria.  If it is 3 years, then the following would eliminate those records:

data test4;

  informat dclrdt yymmdd8.;

  format dclrdt date9.;

  input permno  dclrdt;

  cards;

10006    19620803

10006    19620315

10006    19621102

10006    19630802

10006    19650406

10006    19680406

10007    19620803

10007    19620315

10007    19621102

10007    19630802

10007    19650406

10007    19680405

;

data want (drop=_:);

  do until (last.permno);

    set test4;

    by permno;

    _lastdclrdt=lag(dclrdt);

    if span lt 3 then

      span=intck('year',_lastdclrdt,dclrdt,'C');

  end;

  do until (last.permno);

    set test4;

    by permno;

    if span lt 3 then output;

  end;

run;

totomkos
Calcite | Level 5

Thank you for the help you provide me but i have one more question;

if we have the following sample

10006    19620803

10006    19620315

10006    19621102

10006    19630802

10006    19650406

10006    19680406

10007    19620803

10007    19620315

10007    19621102

10007    19630802

10007    19650406

10007    19680405

;

How can i find how often each company pays dividends (how many days between declarations) and compare that number with the criteria of late payment (3-year period)????

art297
Opal | Level 21

Code like the following could be used to identify days between payments:

data test4;

  informat dclrdt yymmdd8.;

  format dclrdt date9.;

  input permno  dclrdt;

  cards;

10006    19620803

10006    19620315

10006    19621102

10006    19630802

10006    19650406

10006    19680406

10007    19620803

10007    19620315

10007    19621102

10007    19630802

10007    19650406

10007    19680405

;

proc sort data=test4;

  by permo dclrdt;

run;

data want (drop=_:);

  set test4;

  by permno;

  _lastdclrdt=lag(dclrdt);

  if first.permno then call missing(_lastdclrdt);

  span=intck('day',_lastdclrdt,dclrdt,'C');

run;

totomkos
Calcite | Level 5

I run the code you provide me  and find the days between declarations (span variable). Now if  i need to find the omissions

in the sample you give me, taking into account that i have an omission when i have the last declaration date or the previous before the last declaration if the days between the last and the previous to last is over 1128 days. how do i present this into sas code???

kostas

art297
Opal | Level 21

data test4;

  informat dclrdt yymmdd8.;

  format dclrdt date9.;

  input permno  dclrdt;

  cards;

10006    19620803

10006    19620315

10006    19621102

10006    19630802

10006    19650406

10006    19680606

10007    19620803

10007    19620315

10007    19621102

10007    19630802

10007    19650406

10007    19680405

;

proc sort data=test4;

  by permo dclrdt;

run;

data delinquent (drop=_:) non_delinquent (drop=_:);

  do until (last.permno);

    set test4;

    by permno;

    _lastdclrdt=lag(dclrdt);

    if last.permno then

      span=intck('day',_lastdclrdt,dclrdt,'C');

  end;

  do until (last.permno);

    set test4;

    by permno;

    if span gt 1128 then output delinquent;

    else output non_delinquent;

  end;

run;

totomkos
Calcite | Level 5

while i run span=intck('day',_lastdclrdt,dclrdt,'C'); sas informs me that

The INTCK function call has too many arguments. how i overcome this

if i delete "c" i have two sample on with span filled 1095 and one with another value on span for every row...

art297
Opal | Level 21

Which version of SAS are you using?  I ran the code on 9.3

totomkos
Calcite | Level 5

I have sas 9.1 unfortunately this is provided from my university

Any other way to do this????

art297
Opal | Level 21

Since you are only looking for the number of days, just subtract the two dates.  e.g.:

data test4;

  informat dclrdt yymmdd8.;

  format dclrdt date9.;

  input permno  dclrdt;

  cards;

10006    19620803

10006    19620315

10006    19621102

10006    19630802

10006    19650406

10006    19680606

10007    19620803

10007    19620315

10007    19621102

10007    19630802

10007    19650406

10007    19680405

;

proc sort data=test4;

  by permno dclrdt;

run;

data delinquent (drop=_:) non_delinquent (drop=_:);

  do until (last.permno);

    set test4;

    by permno;

    _lastdclrdt=lag(dclrdt);

    if last.permno then

      span=sum(dclrdt-_lastdclrdt);

  end;

  do until (last.permno);

    set test4;

    by permno;

    if span gt 1128 then output delinquent;

    else output non_delinquent;

  end;

run;

totomkos
Calcite | Level 5

what is span 1095 and span 1157, as it is not the diff between days??? i care about the diff in days between 2 declarations and which declaration is the last one or the previous before the last declaration if the days between the last and the previous to last is over 1128 days. the code you sent just add as span a specific number not the number of each one from the previous one??? Then i have to take that difference and compare it to 1128... I hope that i clarify my point better...

art297
Opal | Level 21

They are the difference between the last and next to last dates (i.e., the number of days between those two dates) for each permno.

I apparently don't understand exactly what you are looking for.  Expanding the example data with the values and flags that you want would probably facilitate your receiving the answer you are seeking.

totomkos
Calcite | Level 5
10006   3/8/1962
10006   15/3/1962
10006   2/11/1962
10006   2/8/1963
10006   6/4/1965
10006   6/6/1968
10007   4/5/1975
10007   15/8/1975
10007   2/11/1975
10007   4/1/1976
10007   6/4/1982
10007   7/7/1982

lets say that we have the above sample , as you can see in company with permno 10007 there are quartely distributions until 4/1/1976, then the company stopped paying dividend until 6/4/1982. This is by defintion and omission event (diff> 1128 days). For company 10006 , we have that it stop paying dividend on 6/6/1968, it never distribute dividend again. so if i have these cases in my sample i have to identify both of them adn not nly case 10006, which is easy as i keep the last observation.

So my code for identifying my sample ought to have 2 cases.

a. final distribution if firm never pays dividend again ---no more data---keep the last distribution

b. previous to last observation -last observation >1128  then i have also an omission and keep the previous to last abservation. ("last" does not mean that firm stop paying dividend for ever...for example a company had a long history of distributions, it stops for 5 years adn then started again -in this case i need the last observation before it stops paying .

I think that now it is clearer

thank you very much

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 19 replies
  • 2365 views
  • 0 likes
  • 4 in conversation