I am trying to use the Year function to make a year variable using a date variable. Below is the excerpt of the code I'm using, along with the error message I am getting. I have broken it up into different data steps as I've tried a few different ways to get the Year function to work but haven't been able to get it to work. Could someone please provide some guidance? Thanks! CODE: data retained; set period; where date >= '1Jan2010:0:0:0'dt; keep date; Data retained2; set retained; date1 = put(date,datetime7.); Data retained3; set retained2; year = year(date1); ERROR Message: NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 41:17 NOTE: Invalid numeric data, date1='01JAN15' , at line 41 column 17.
... View more