I've dates like01:unk:1997 18:unk:1999 Unk:09:2000 Unk:unk:2010; So I'm trying to convert these partial dates to normal by using these conditions... If date is missing so take 01 when month between jan-jul otherwise take 30 If month is missing take 01 when date between 1 t0 15 otherwise 12.. So I run below program it shows some notes like invalid numeric data month='unk' ...... So please modify below program Data hx; Set for; Day=scan(start date,1,':'); Month=scan(start date,2,':'); Year=scan(start date,3,':'); If day='unk' then do; If month in(01:06) then day='01'; Else if month in (07:12) then day='30'; End; If month='unk' then do; If day in(01:06) then month='01'; Else if day in (07:12) then month='12'; End; If month='unk' then month='01'; If day='unk' then day='01'; Date=mdy(month,day,year); Run
... View more