
/* Program creates a data vector that contains one observation for each executive in each year */

options nonotes;

libname lib100 "W:\Tutkimusprojektit\Kirjanpito\Dokumentaatio\JAR\Datat\";
run; 

data years;
 input YEAR;
 cards;
1969
1970 
1971 
1972 
1973
1974
1975
1976
1977
1978
1979
1980 
1981 
1982 
1983
1984
1985
1986
1987
1988
1989
1990 
1991 
1992 
1993
1994
1995
1996
1997
1998
1999
2000 
2001 
2002 
2003
2004
2005
2006
2007
2008
2009
2010 
2011 
2012 
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
;
run;

data structure;
 ID = 0;
 YEAR = 0;
run;

%macro ESTIM (ds=);
%global ID;

data xset1;
 set &ds;
 ID = &x;
 proc append base = structure data = xset1;
%mend ESTIM;

%macro LOOP (dset=);
 %do X = 1 %to 624840;  * <-- N Executives;
 %ESTIM (ds=&dset);
 %end;
%mend LOOP;

%loop (dset = years);
run;

data final;
 set structure;
 if YEAR = 0 then delete;
run;

data lib100.henkilovuodet_150324;
 set final;
run;
