Hi @Ameurgen
Oh, I understand your answer to mean that you want the year shifted one month, so december is part of the winter season in the following year. You could easily obtain that with my code (change marked with red text😞
data want;
set have;
length Season $12;
select;
when (month(Date) in(12, 1, 2)) Season = 'Winter';
when (month(Date) in(3, 4, 5)) Season = 'Spring';
when (month(Date) in(6, 7, 8)) Season = 'Summer';
when (month(Date) in(9, 10, 11)) Season = 'Fall';
otherwise Season = 'n.a.';
end;
Season = catx(' ', put(year(Date)+(month(date)=12),4.), Season);
run;
... View more