I used the following code as I cant format the year variable in data set a. (they all became 1965 after I used year4. format ). this code generated record that are one year prior to yearfiled date. proc sql;
create table own.own_patent_list
as select a.*, b.*
from own.sub_9110 as a left join own.dir_own as b
on a.cusip=b.cusip
and year=yearfiled-1;
quit; but I still have one question: I also tried the second code you provided (year between yearfiled-3 and yearfiled-1;) to replace year=yearfiled-1, and then this time I have maximum of three records for each company. what if I want to pick the first nonzero value within those three rows of records for that company, and delete the rest? I cant use if statement in pro sql, so any ideas ?? Thanks
... View more