Dear, I am running following program. i am not getting the out I need. please suggest. Thank you data one; input cmendtc_raw $11.; datalines; UN/Feb/2015 ; data two; set one; cmendtc=put(input(cmendtc_raw, ?? date11.),yymmdd10.); if missing(cmendtc) and not missing(cmendtc_raw) then do; length _day1 _month1 _year1 8; _day1 =input(scan(cmendtc_raw,1,'/','m'), ?? best32.); _month1=month(input(scan(cmendtc_raw,2,'/','m')||'2000', ?? monyy.)); _year1 =input(scan(cmendtc_raw,3,'/','m'),?? best32.); end; if _day1<1 or _day1>31 then call missing(_day1); if _month1<1 or _month1>12 then call missing(_month1); /* valid day and year? */ if mdy(01,_day1,_year1) then cmendtc=put(_year1,z4.)||'--'||put(_day1,z2.); /* valid month and year? */ else if mdy(_month1,01,_year1) then cmendtc=put(_year1,z4.)||'-'||put(_month1,z2.); /* valid year? */ else if mdy(02,01,_year1) then cmendtc=put(_year1,z4.); run; output need: 2015-02 I am seeing a blank value " .' . The missing function is not recognizing. Please help. Thank you
... View more