data credit1;
set credit;
format datadate year.;
rename datadate = year;
run;
proc sql;
create table credtY as
select cusip, year, mean(rating) as ratingY
from credit1
group by cusip, year;
quit;
Hi!
There is no error or warning sign on the above coding... So I think the code itself works but I need sth else to get what I want.
I ran the code to get yearly average ratings(ratingY) for each frim of each year.
However, what I get is the same monthly ratings as the previous data file is.
I changed YYMMDD date to Year and use the code.
Assuming the reason why I couldn't obtain the desired outcome is 1) many duplicates or 2) Year is not really a year but YYMMDD...
To resolve this issue, I used "nodupkey" to delete duplicates but failed to delete them at all.
I would like to ask how can I can yearly average of each firm when I have seemingly duplicate Years BUT possibly YYMMDD.
Yeah... I passed the first hurdle. But... if my YEARS are based on underlying values, how can I merge later? I need to use YEAR to match... Can I use input() statement to convert my YEAR to a PURE year?
If not... is there any ways to use this YEAR with underlying values for matching with normal pure years?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.