SAS reading data from file containing tab and comma delimiters -
so problem tab delimiter defined '09'x , , comma - ",". know can use multiple delimiters if have e.g. colon , comma , define ":," dont know how define multiple delimiter of tab , comma. data file looks this:
aislelevels: 14, enroute: 10, orderavg: 2, psnum: 2, pstype: 1, aisleslots: 150, nop: 1 run 1 run 2 run 3 run 4 run 5 rn set 1 rn set 2 rn set 3 rn set 4 rn set 5 elevutil 0.147 0.147 0.149 0.139 0.142 msutil 0.186 0.186 0.189 0.174 0.182 pickutil 0.417 0.424 0.417 0.394 0.407 tput 668 678 666 632 649
first row delimited comma, , else tab.. thank help!
i not use multiple delimiters; read whole thing tab delimited, , parse first line separately.
something this:
data want; infile datalines dlm='09'x truncover; if _n_ = 1 do; input @1 str $1500.; *(parse string scan); levels=scan(str,1,','); enroute = scan(str,2,','); /*etc.*/ end; else input (run1-run5) $ /*....*/ ; run;
usually output after non-first-row , retain first row variables well, if that's need (having variables on rows). don't totally understand format; want 5 rows data (beyond first)? different dp issue.
Comments
Post a Comment