07-26-2016 06:42 PM
I'm trying to read a tab delimited file with the first row containing a header. My goal is to get the header line only for a large number of datasets that vary in size and construction. Because the header lines are variable in length and can contain hundreds of fields, I can't set the lrecl to the exact width of any header line. When the input length upper limit is less than the length of the header line, the header line imports but is short of the last field; however, when I make the length longer than the length of the header line, so that it goes into line 2, it ignores the header line completely, and acts as though line 2 is the first line of the file.
The code below shows basically what I'm trying to do. I've tried everything I can think of without success. Any feedback is appreciated.
infile "H:\file.tsv" firstobs=1;
input lines $1-20000;
if _N_ eq 1;
Need further help from the community? Please ask a new question.