Hi
Nicole's "Reading a CSV file" reminded me that I'm having this long lasting unanswered question.
I believe it's not possible but I would be happy to be told otherwise.
O.K., here it comes:
Have: A pipe delimited file
Want: Read the 3rd column without having to map column 1 and 2 only using input statement.
data have;
infile datalines dlm='|' dsd truncover;
input VarForCol_C $;
datalines;
a1|b_1|c1
a2||c2
;
run;
I know that I could do something like...
...
input;
VarForCol_C=scan(_infile_,3,'|');
...
...but I'm wondering if I'm missing something and it could be done with some "switches" for the input statement without having to create any unnnecessary variables.
I'm looking for a generic solution which works for any number of fields(i.e. read field 15 in string with 50 fields).
Cheers
Patrick