Suggest you input the field using $CHARnn. and then using the INPUT function, attempt to convert (or use the NOT ANYALPHA() function, possibly, to validate for all numeric and then perform the INPUT. Still, in case the conversion does not work, I would suggest resetting the SAS reserved variable _ERROR_=0 to avoid the nasty warning messages in the SAS log, as well, after you attempt the INPUT -- and also test the "date" numeric variable for a missing condition, which will tell you what happened with the INPUT.
You should do some diagnostic testing with the statement below - at various places in your SAS DATA step logic to better understand your input:
Exactly the point - suggest reading the field into a SAS CHARACTER variable and then validate it or just run it against a suitable INFORMAT using the INPUT function creating a SAS numeric (date) variable. If the resulting SAS numeric variable value is a SAS missing value, you have an invalid date string.
Also, it's unclear what you mean by "this did not work" -- exactly what did you attempt and what was the specific result -- the SAS log with your program code pasted into a post reply would be useful in order to help diagnose the situation accurately.
Suggestion was to paste the SAS log (output) to show the SAS diagnostics or any additional PUTLOG code you would have defined to show exactly what "did not work". Pasting the code without additional benefit of SAS log processing information is limited value to get feedback.
And, as I suggested initially, consider doing the INPUT to a character variable, validate the content, using a SAS function such as ANYALPHA, and then doing the INPUT function in an assignment.
you can create a special user informat to detect specific strings replaced with for example special missing values, and apply the informat for the rest, with code like[pre]
proc format ;
'State St' = .S
'Deutsche' = .D
other = [yymmdd8.]
This informat would be used like[pre]
infile 'yourFile' ..................... truncover ;
input date_special myYMD. ;
After that you can identify the special cases and handle them however you need.