Probably easiest to read it as character and then add your own logic to validate and convert the value. You can even trap the invalid values and generate you own error messages. data _null_ ; input datestr $10.; select ; when (. ne input(datestr,??comma32.)) date=input(datestr,comma32.)+'01JAN1900'd - 2 ; when (. ne input(datestr,??mmddyy10.)) date=input(datestr,mmddyy10.); when (. ne input(datestr,??yymmdd10.)) date=input(datestr,yymmdd10.); when (. ne input(datestr,??ddmmyy10.)) date=input(datestr,ddmmyy10.); otherwise date=.; end; if date=. and datestr ne ' ' then put 'ERROR: Invalid Date String. ' datestr=; format date date9.; put (datestr date) (=); cards; 1/1/1965 41,974 41974 Bad Date. 2014/01/30 30/12/2013 ;;;;
... View more