In the future you might consider addressing such issues when reading the data, especially with 50 (apparently) identical values. Custom informats created with Proc Format can address much of this at input time.
proc format library=work;
invalue qst
'Do not know' =.
'No, strongly disagree' =1
'No, somewhat disagree' =2
'Neither agree nor disagree' =3
'Yes, somewhat agree' =4
'Yes, strongly agree' =5
other = _error_;
run;
data example;
informat q1 q2 qst.;
infile datalines dlm=',' dsd;
input q1 q2;
datalines;
'No, strongly disagree','Yes, strongly agree'
'Yes, somewhat agree','No, somewhat disagree'
'Neither agree nor disagree','Unexpected text'
;
run;
Note that I included an other category in the informat that treats unexpected values as an error. This can alert you to some systematic problems if the value should be present all the time.
If the questions are sometimes allowed to not have an answer you might consider using a special missing for the "Do not know" response such as .N and add a ' '=. to address the error that the other would otherwise report to the informat. You could differentiate if needed between the "Do not know" and not answered at all if needed.
If without changing you input you could modify the code of your loop to:
do i=1 to 50;
answer1a [i]= input(answer1 [i], qst.);
end;
One advantage of this approach is if the next iteration of the survey adds a value such as "Refused to answer" then you only need to add the text and desired value (possibly missing) to the Proc format code, rerun the format and the body of the code doesn't need to change at all to get the new response(s) handled.