<?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 Re: raw file with commas and double quotes in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/raw-file-with-commas-and-double-quotes/m-p/359492#M84548</link>
    <description>&lt;P&gt;It really helps to provide the exact code you are using as we have no clue what your variable names are without.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may either have to edit your file (easiest and quickest though a pain) or learn to write your own code to parse a line of text that will work. There is no easy quick fix for garbage data.&lt;/P&gt;
&lt;P&gt;Note that this should read okay:&lt;/P&gt;
&lt;PRE&gt;19182,19182,0,3783484502,"Mays","Chad Ronald","Mays, Kay or Mays, Hank Ch","13 Moonlight Dr"
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to go back to the data source and tell them that some one is entering " &amp;nbsp;characters into what appears to be (a poorly defined or structured) name field inappropriately.&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2017 20:57:39 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-05-17T20:57:39Z</dc:date>
    <item>
      <title>raw file with commas and double quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/raw-file-with-commas-and-double-quotes/m-p/359472#M84537</link>
      <description>&lt;P&gt;I have a txt file to read in like so (headers are added by me):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Last &amp;nbsp; &amp;nbsp; &amp;nbsp;First &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Guardians &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Address&lt;/P&gt;
&lt;P&gt;1968451595,"Smith","Dianne","Smith, Patty or Smith, David","90 Flyth Rd",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my infile statement:&lt;/P&gt;
&lt;P&gt;infile "G:\Departments\Research\test scores\GT\&amp;amp;yr.\GIFT.txt" dlm = '",' MISSOVER lrecl=32767 firstobs=2 ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem I'm encountering is the guardian field &amp;gt;&amp;nbsp;&lt;SPAN&gt;"Smith, Patty or Smith, David". Many of observations have commas that are meant to simply separate their last and first name but are not meant to be delimiters. This is causing my SAS data set to read invalid data for these observations.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 19:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/raw-file-with-commas-and-double-quotes/m-p/359472#M84537</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2017-05-17T19:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: raw file with commas and double quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/raw-file-with-commas-and-double-quotes/m-p/359475#M84538</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile "G:\Departments\Research\test scores\GT\&amp;amp;yr.\GIFT.txt" DSD truncover lrecl=32767 firstobs=2 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Try above.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have embedded commas in a field, the correct convention is to quote them if the file is comma delimited, so someone actually created your file correctly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 19:53:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/raw-file-with-commas-and-double-quotes/m-p/359475#M84538</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-17T19:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: raw file with commas and double quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/raw-file-with-commas-and-double-quotes/m-p/359477#M84539</link>
      <description>&lt;P&gt;Ok, this was helpful. It read about 6K obs before hitting another snag.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;19182,19182,0,3783484502,"Mays","Chad Ronald","Mays, Kay or Mays, Hank "Ch","13 Moonlight Dr",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears the problem starts at the guardian field again but this time because of quotes within the field, i.e. "Ch"&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 20:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/raw-file-with-commas-and-double-quotes/m-p/359477#M84539</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2017-05-17T20:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: raw file with commas and double quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/raw-file-with-commas-and-double-quotes/m-p/359492#M84548</link>
      <description>&lt;P&gt;It really helps to provide the exact code you are using as we have no clue what your variable names are without.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may either have to edit your file (easiest and quickest though a pain) or learn to write your own code to parse a line of text that will work. There is no easy quick fix for garbage data.&lt;/P&gt;
&lt;P&gt;Note that this should read okay:&lt;/P&gt;
&lt;PRE&gt;19182,19182,0,3783484502,"Mays","Chad Ronald","Mays, Kay or Mays, Hank Ch","13 Moonlight Dr"
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to go back to the data source and tell them that some one is entering " &amp;nbsp;characters into what appears to be (a poorly defined or structured) name field inappropriately.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 20:57:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/raw-file-with-commas-and-double-quotes/m-p/359492#M84548</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-17T20:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: raw file with commas and double quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/raw-file-with-commas-and-double-quotes/m-p/359567#M84562</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13712"&gt;@GreggB&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Ok, this was helpful. It read about 6K obs before hitting another snag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;19182,19182,0,3783484502,"Mays","Chad Ronald","Mays, Kay or Mays, Hank "Ch","13 Moonlight Dr",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appears the problem starts at the guardian field again but this time because of quotes within the field, i.e. "Ch"&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13712"&gt;@GreggB&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Ok, this was helpful. It read about 6K obs before hitting another snag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;19182,19182,0,3783484502,"Mays","Chad Ronald","Mays, Kay or Mays, Hank "Ch","13 Moonlight Dr",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appears the problem starts at the guardian field again but this time because of quotes within the field, i.e. "Ch"&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;There seems to be a problem with the program creating your .csv file. If possible, tell the guys who create the file that they should double double quotes (sic) in text fields, like in&amp;nbsp;&lt;SPAN&gt;"Mays, Kay or Mays, Hank ""Ch".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Søren&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 08:14:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/raw-file-with-commas-and-double-quotes/m-p/359567#M84562</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2017-05-18T08:14:11Z</dc:date>
    </item>
  </channel>
</rss>

