See this:
data want;
set one;
year = input(scan(date,1,"-","m"),4.);
month = input(scan(date,2,"-","m"),2.);
day = input(scan(date,3,"-","m"),2.);
if year and month and day or not year and not month and not day
then dtf = " ";
else if not year
then dtf = "y";
else if not month
then dtf = "m";
else dtf = "d";
run;
With incomplete dates, I would keep separate year/month/day variables, to enable end users to deal with the missing values in a way that is appropriate for their current needs.
... View more