Hello
I want to segregate the dataset based on the unique values of a variable:
Ex. The database name is DB. Date is one of the column in MONYY5. format:
Date |
Oct14 |
Nov14 |
Dec14 |
Jan15 |
Feb15 |
Mar15 |
Apr15 |
data OCT14;
set DB;
where MONTH(Date) EQ 10 and YEAR(Date) Eq 2014;
run;
data NOV14;
set DB;
where MONTH(Date) EQ 11 and YEAR(Date) Eq 2014;
run;
data DEC14;
set DB;
where MONTH(Date) EQ 12 and YEAR(Date) Eq 2014;
run;
This has to be repeated number of times as the unique values in the date column.
The general logic which I am trying to get is:
Data Oct14;
set DB;
where date=Oct14;
run;
Just write this one and loop it for all the unique values available in the date column.
Thanks
Chandan Mishra