You'll need a couple of things:
1. A way to identify the start of each company (BY GVKEY)
2. A way to reference the previous observation (LAG/DIF Function)
3. You'll have to check your data - do you need to account for missing years somehow? I'll leave that as an exercise for you at the moment.
data have;
input gvkey fiscal_year sales ;
cards;
1004 1992 200
1004 1993 220
1004 1994 210
1005 1992 355
1005 1993 400
1006 1992 412
1006 1993 500
1007 1992 1520
1007 1993 1580
1007 1994 2000
1007 1995 1890
1007 1996 1400
;
run;
data want;
set have;
by gvkey;
lag_sales=lag1(sales);
if first.gvkey then growth=.;
else growth=(sales-lag_sales)/lag_sales;
format growth percent8.1;
run;
... View more