Reputation: 399
I formatted the date column within my table, using the following code;
data data1;
set data;
format Date ddmmyy10.;
run;
I want to know how I can create a new column within my table which just extracts the month and year from the dates in the "Date" column.
How do I do this please?
Upvotes: 0
Views: 1489
Reputation: 26
in order to create new columns calculated by existing Date column you should try this:
data data1;
set data;
format Date ddmmyy10.;
yearNo=year(Date);
monthNo=month(Date);
run;
Upvotes: 0