@ rw9 here's my log with the code & errors... 57 data have; 58 input birthdate $; 59 cards; NOTE: The data set WORK.HAVE has 4 observations and 1 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.02 seconds 64 run; 65 66 data want; 67 set have; 68 day=substr(birthdate,1,2); 69 month=substr(birthdate,5,7); 70 year=substr(birthdate,8,6); 71 if day="-" then day="01"; 72 if month="--" then month="JAN"; 73 if year="-" then year="0000"; 74 converted_date=input(cats(day,month,year),date9.); 75 format converted_date date9.; 76 run; NOTE: Invalid third argument to function SUBSTR at line 69 column 9. NOTE: Invalid third argument to function SUBSTR at line 70 column 8. NOTE: Invalid argument to function INPUT at line 74 column 18. birthdate=-Jan-197 day=-J month=-197 year=7 converted_date=. _ERROR_=1 _N_=1 NOTE: Invalid third argument to function SUBSTR at line 69 column 9. NOTE: Invalid third argument to function SUBSTR at line 70 column 8. NOTE: Invalid argument to function INPUT at line 74 column 18. birthdate=--1977 day=-- month=77 year= converted_date=. _ERROR_=1 _N_=2 NOTE: Invalid third argument to function SUBSTR at line 69 column 9. NOTE: Invalid third argument to function SUBSTR at line 70 column 8. NOTE: Invalid argument to function INPUT at line 74 column 18. birthdate=02--1978 day=02 month=1978 year=8 converted_date=. _ERROR_=1 _N_=3 NOTE: Invalid third argument to function SUBSTR at line 69 column 9. NOTE: Invalid third argument to function SUBSTR at line 70 column 8. NOTE: Invalid argument to function INPUT at line 74 column 18. birthdate=03-Jan- day=03 month=an- year= converted_date=. _ERROR_=1 _N_=4 NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to missing values. Each place is given by: (Number of times) at (Line):(Column). 4 at 74:18 NOTE: There were 4 observations read from the data set WORK.HAVE. NOTE: The data set WORK.WANT has 4 observations and 5 variables.
... View more