Hi, SAS Users- Me again. I'm trying to change a date (stored in two variables, one with a SAS date format and the other as numeric) to a string variable with a two-digit year and a three character month abbreviation--e.g., "16-Jan". Ultimately, I want to join the data I'm prepping with another file, which has months in this format. But instead of getting "16-Jan", I get "65-Jan": right month, but wrong year. Here's the code I'm using: data ucd5;
set ucd4;
highmme_rate = highmme/pop*100000;
month = put(date2, monname3.);
monyear2 = cats(put(year(date2), year2.),"-", put(date2, monname3.));
year2 = put(year(date2), year.);
*format date yymon.;
drop monyear;
run; Here's some sample rows from the input data ("ucd4"): As readily seen, the date variable ("date") maps correctly on to the number of days since Jan 1, 1960: 2016-01-01 is, in fact 20454 days from 1960-01-01. The above code gets the month right, but outputs the year as 1965. Here are some sample rows from the created dataset ("ucd5"): Any ideas on what's going on? Since the code outputs 1965 as the year from both the "date" and the "date2" variables, I suspect that the origin date is something other than 1960-01-01. How can I check and, if appropriate, reset the origin date? Or is the problem something else? Many thanks, David
... View more