Your problem is you're using space delimited data input. Is it truly space delimited, though, or is it columnar (fixed position)?
data test;
input names $ 1-4 score1 5-12 score2 13-20;
cards;
A1 80 95
A 2 80 95
;
run;
If it's truly delimited and you're just not exactly replicating the data here, you have a few choices. You can use the &
character to ask SAS to look for two consecutive spaces to be a delimiter, but your actual data doesn't have that correctly either - but it would look like so:
data test;
input names &$ score1 score2;
cards;
A1 80 95
A 2 80 95
;
run;
Or if you truly have the issue here that you have some single spaces that are delimiters and some single spaces that are not, you'll have to work out some sort of logic to do this. The exact logic depends on your rules, but here's an example - here I look for that space, and assume that if it is there then there is exactly one more character, then I want to move everything down one so that I have a guaranteed double space now. This is probably not a good rule for you, but it is an example of what you might do.
data test;
input @;
if substr(_infile_,2,1)=' ' then do; *if there is a space at spot two specifically;
_infile_ = substr(_infile_,1,3)||' '||substr(_infile_,4); *shift everything after 3 down;
end;
input names &$ score1 score2;
cards;
A1 80 95
A 2 80 95
;
run;