@wentao wrote:
That's my code.
But the first row of results still have headers for every variables. And all values are missing quotation marks.
I see nothing in your post about not wanting the header row only that you couldn't use the putnames statement.
if _n_ > 1 then put _infile_;
will write other than the header rows.
It appears that you may have destroyed your orginal file by using proc export to write over it. Proc Exported removed any quotes that did not need quotes.. Quotes around a single word or phrase with no embedded commas in CSV are not needed and were likely replaced by Export, not by the PUT _INFILE_ which would keep the quotes. Then rereading the file that had the quotes removed means they are not there to write with a PUT statement.
Also, did you open that CSV with Excel or a text editor such as Wordpad or Notepad? Excel will not show the quotes generally. And may remove those that are there if you save the file.
Your data _null_ program does not need the SET statement.
... View more