@ballardw wrote:
Unfortunately parsing _infile_ may require a bit more work depending on the actual content of the data.
Consider:
data junk;
infile datalines dlm=',';
input;
put _infile_;
Name = scan(_infile_, 1, ",");
Age = input(scan(_infile_, 3, ","), best.);
datalines;
"Jones, Smith",23
;
run;
The put was included so we can see that _infile_ behaves as expected with datalines input. The kicker is that the name is truncated but does read the age for this one.
@sks521 really needs to post example data if one of the posted solutions hasn't worked.
Using Q as third argument in scan should solve such issues. Adding M to the third parameter helps, if some variable could be missing.