<?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: Reading a CSV file having double quotes in SAS DI in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471966#M14791</link>
    <description>&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;I just notice that the College is taking more space characters and the length should be around 200.&lt;/P&gt;&lt;P&gt;If i gave 200 then&amp;nbsp;I am not getting missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, how can I handle that spaces in csv file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Vickys&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jun 2018 02:19:42 GMT</pubDate>
    <dc:creator>vickys</dc:creator>
    <dc:date>2018-06-21T02:19:42Z</dc:date>
    <item>
      <title>Reading a CSV file having double quotes in SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471585#M14781</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can some please help me t how to deal a csv file data like this in SAS DI.&lt;BR /&gt;I tried with comma as delimiter while create a file through external wizard.&lt;BR /&gt;When the file reader reads the data from the data file, its shows missing(.) for 2013 and 2014 data, as the collage has double quotes and has comma.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But, my file reader code has following code, which makes sense in handling the double quotes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;infile '/*/*/test_data.csv'&lt;BR /&gt;lrecl = 379&lt;BR /&gt;delimiter = ','&lt;BR /&gt;dsd&lt;BR /&gt;missover&lt;BR /&gt;firstobs = 2;&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;File data-:&lt;BR /&gt;year , dept, class, collage,total&lt;BR /&gt;2012, science, two, abc, 23&lt;BR /&gt;2012, maths, three, abc, 34&lt;BR /&gt;2013, science, four, "abc,xyz", 55&lt;BR /&gt;2013, social, five, "asd,jhg", 21&lt;BR /&gt;2014, maths, two, "qwe,lki", 37&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Vicks&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 03:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471585#M14781</guid>
      <dc:creator>vickys</dc:creator>
      <dc:date>2018-06-20T03:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file having double quotes in SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471589#M14782</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207150"&gt;@vickys&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Please post the full data step as generated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below works for me - but that's not necessarily "100%" identical to what you get as generated code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  infile datalines
    /*lrecl = 379*/
  delimiter = ','
  dsd
  missover
  firstobs = 2;
  ;

  attrib year length=8;
  attrib dept length=$10;
  attrib class length=$10;
  attrib collage length=$10;
  attrib total length=8;

  input year dept class collage total;

  datalines;
year , dept, class, collage,total
2012, science, two, abc, 23
2012, maths, three, abc, 34
2013, science, four, "abc,xyz", 55
2013, social, five, "asd,jhg", 21
2014, maths, two, "qwe,lki", 37
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jun 2018 04:02:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471589#M14782</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-06-20T04:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file having double quotes in SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471963#M14789</link>
      <description>&lt;P&gt;Thanks Patrick,&lt;/P&gt;&lt;P&gt;&amp;nbsp;The code is similar to what you said and its working while I ran&amp;nbsp; in editor. But, the table reader output is showing missing values,I think something is gng wrng.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work.WCPGEZNZ / view = work.WCPGEZNZ ;&lt;BR /&gt;infile '/sasdat/test_data.csv'&lt;BR /&gt;lrecl = 379&lt;BR /&gt;delimiter = ','&lt;BR /&gt;dsd&lt;BR /&gt;missover&lt;BR /&gt;firstobs = 2;&lt;BR /&gt;;&lt;BR /&gt;attrib YEAR length = $4;&lt;BR /&gt;attrib Dept length = $22;&lt;BR /&gt;attrib Class length = $39;&lt;BR /&gt;attrib College length = $51;&lt;BR /&gt;attrib Total length = 8;&lt;BR /&gt;&lt;BR /&gt;input YEAR Dept Class College Total ;&lt;BR /&gt;&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;Thanks,&lt;/P&gt;&lt;P&gt;Vickys&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 01:36:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471963#M14789</guid>
      <dc:creator>vickys</dc:creator>
      <dc:date>2018-06-21T01:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file having double quotes in SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471966#M14791</link>
      <description>&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;I just notice that the College is taking more space characters and the length should be around 200.&lt;/P&gt;&lt;P&gt;If i gave 200 then&amp;nbsp;I am not getting missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, how can I handle that spaces in csv file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Vickys&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 02:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471966#M14791</guid>
      <dc:creator>vickys</dc:creator>
      <dc:date>2018-06-21T02:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file having double quotes in SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471971#M14792</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207150"&gt;@vickys&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I can't replicate the issue you describe so there must be something else going on which is not in your sample data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For observations where you get a missing: Have you checked in the .csv if there are any special characters in this line like Tab or LF?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At least for testing purposes I'd create a table and not a view as output. That makes it easier to see issues in the log at the place where they actually occur and not only where the view gets executed.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 03:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471971#M14792</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-06-21T03:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file having double quotes in SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471986#M14796</link>
      <description>&lt;P&gt;Yes, its problem with Logical record length.&lt;/P&gt;&lt;P&gt;I just made that table and checked the log and rectified the length. It worked.&lt;/P&gt;&lt;P&gt;cheers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Patrick&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 06:25:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-CSV-file-having-double-quotes-in-SAS-DI/m-p/471986#M14796</guid>
      <dc:creator>vickys</dc:creator>
      <dc:date>2018-06-21T06:25:07Z</dc:date>
    </item>
  </channel>
</rss>

