<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Read Raw data file and export in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-Raw-data-file-and-export/m-p/325324#M72349</link>
    <description>&lt;P&gt;Hi, I am new to SAS and I am just doing a simple practise now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Say now I have a txt raw data file looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ABDSADJFASF",6,7,"SDDASDJASD", 12/12/2012, "ASDSDADASD",0.0,0.0.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"FGHJKJHGGHJK",6,7,"SUUNSDHDHH", 11/12/2009, "AFSDFDGDSGSD",0.0,0.0.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I can read in all the vars by set them all as char(using :&amp;amp;)&amp;nbsp;and then output the dataset with exactly the values between dlm ',' (ie. some values with quotes and some don't).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But how can I convert the dataset back to another&amp;nbsp;txt file, which should be exacly like the raw txt file?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I was using proc export but I can't use putnames statement since my version is 9.1, any workaround?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2017 16:23:23 GMT</pubDate>
    <dc:creator>wentao</dc:creator>
    <dc:date>2017-01-17T16:23:23Z</dc:date>
    <item>
      <title>Read Raw data file and export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-Raw-data-file-and-export/m-p/325324#M72349</link>
      <description>&lt;P&gt;Hi, I am new to SAS and I am just doing a simple practise now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Say now I have a txt raw data file looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ABDSADJFASF",6,7,"SDDASDJASD", 12/12/2012, "ASDSDADASD",0.0,0.0.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"FGHJKJHGGHJK",6,7,"SUUNSDHDHH", 11/12/2009, "AFSDFDGDSGSD",0.0,0.0.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I can read in all the vars by set them all as char(using :&amp;amp;)&amp;nbsp;and then output the dataset with exactly the values between dlm ',' (ie. some values with quotes and some don't).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But how can I convert the dataset back to another&amp;nbsp;txt file, which should be exacly like the raw txt file?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I was using proc export but I can't use putnames statement since my version is 9.1, any workaround?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 16:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-Raw-data-file-and-export/m-p/325324#M72349</guid>
      <dc:creator>wentao</dc:creator>
      <dc:date>2017-01-17T16:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read Raw data file and export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-Raw-data-file-and-export/m-p/325328#M72351</link>
      <description>&lt;P&gt;Is the purpose to manipulate the data and create output or to create an exact duplicate of the input text file?&lt;/P&gt;
&lt;P&gt;If the later case then look at PUT _infile_; with&amp;nbsp;the new file name in a&amp;nbsp;FILE statement&amp;nbsp;in the data step you read the file with.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 16:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-Raw-data-file-and-export/m-p/325328#M72351</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-17T16:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Read Raw data file and export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-Raw-data-file-and-export/m-p/325337#M72353</link>
      <description>&lt;P&gt;libname library 'c:\';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;filename final 'c:\final_out.txt';&lt;BR /&gt;proc export data=library.test&lt;BR /&gt;outfile="&lt;SPAN&gt;c:\&lt;/SPAN&gt;&lt;SPAN&gt;final_out.txt&lt;/SPAN&gt;"&lt;BR /&gt;dbms=csv replace;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; infile "&lt;SPAN&gt;c:\&lt;/SPAN&gt;&lt;SPAN&gt;final_out.txt"&lt;/SPAN&gt; firstobs=2;&lt;BR /&gt;set library.test;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; file "c:\final_out.txt";&lt;BR /&gt;input;&lt;BR /&gt;put _infile_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the first row of results still have headers for every variables. And all values are missing quotation marks.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 16:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-Raw-data-file-and-export/m-p/325337#M72353</guid>
      <dc:creator>wentao</dc:creator>
      <dc:date>2017-01-17T16:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Read Raw data file and export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-Raw-data-file-and-export/m-p/325396#M72367</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122611"&gt;@wentao&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;That's my code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the first row of results still have headers for every variables. And all values are missing quotation marks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I see nothing in your post about not wanting the header row only that you couldn't use the putnames statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if _n_ &amp;gt; 1 then put _infile_;&lt;/P&gt;
&lt;P&gt;will write other than&amp;nbsp; the header rows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your data _null_ program does not need the SET statement.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 18:36:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-Raw-data-file-and-export/m-p/325396#M72367</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-17T18:36:59Z</dc:date>
    </item>
  </channel>
</rss>

