<?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 ; (semicolon) and , (comma) in the date and  How to output in csv file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413893#M101360</link>
    <description>&lt;P&gt;comma can be used as delimiter, but there is only one semicolon (;), how could we deal with it ??&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2017 05:08:26 GMT</pubDate>
    <dc:creator>buddha_d</dc:creator>
    <dc:date>2017-11-16T05:08:26Z</dc:date>
    <item>
      <title>reading ; (semicolon) and , (comma) in the date and  How to output in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413883#M101352</link>
      <description>&lt;P&gt;folks, could you please tell me which function to use to correct the name sothat either I get rid of ; and ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;or replace ; with , and use translate function in my output .csv file?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I am unable to read the data to begin with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;thanks in advance.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data check;&lt;BR /&gt;input name $150.;&lt;BR /&gt;name_correct=compress(name,'','');&lt;BR /&gt;cards;&lt;BR /&gt;daniel - height 72 inches, weight 250 pounds;race african american&lt;BR /&gt;jack - height 60 inches, weight 150 pounds,race Caucasian&lt;BR /&gt;Lee - height 75 inches, weight 175 pounds,race mixed&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;data _null_;&lt;BR /&gt;set check;&lt;BR /&gt;file "path.csv";&lt;BR /&gt;put 'demographics';&lt;BR /&gt;put 'name';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 04:34:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413883#M101352</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2017-11-16T04:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: reading ; (semicolon) and , (comma) in the date and  How to output in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413884#M101353</link>
      <description>&lt;P&gt;sorry for the typo in the message heading (data instead of date)&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 04:35:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413884#M101353</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2017-11-16T04:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: reading ; (semicolon) and , (comma) in the date and  How to output in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413886#M101354</link>
      <description>&lt;P&gt;They look like delimiters, why not treat them as such?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 04:37:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413886#M101354</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-16T04:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: reading ; (semicolon) and , (comma) in the date and  How to output in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413888#M101355</link>
      <description>&lt;P&gt;Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I want to get it out as it is or with commas or space delimiters, but as a single row. so we will have 3 rows in output. Getting semicolon out of my way is the big problem and I can't find solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 04:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413888#M101355</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2017-11-16T04:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: reading ; (semicolon) and , (comma) in the date and  How to output in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413893#M101360</link>
      <description>&lt;P&gt;comma can be used as delimiter, but there is only one semicolon (;), how could we deal with it ??&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 05:08:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413893#M101360</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2017-11-16T05:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: reading ; (semicolon) and , (comma) in the date and  How to output in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413898#M101362</link>
      <description>&lt;P&gt;What are you trying to do? Are you trying to read that data into a dataset?&amp;nbsp; If so what do you want the result to look like?&lt;/P&gt;
&lt;P&gt;It looks more like you are reading it in and then writing it back out again to another text file.&amp;nbsp; Why?&lt;/P&gt;
&lt;P&gt;Perhaps you want to re-write it with the semi-colons replaced by commas?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check;
  infile cards truncover ;
  input line $char150.; 
  line = translate(line,',',';');
  file 'path.csv' ;
  len = lengthn(line);
  put line $varying150. len ;
cards4;
daniel - height 72 inches, weight 250 pounds;race african american
jack - height 60 inches, weight 150 pounds,race Caucasian
Lee - height 75 inches, weight 175 pounds,race mixed
;;;;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Perhaps you can just read it as it is?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check;
  length name height weight race $100 ;
  infile cards dsd dlm='-,;' truncover ;
  input name height weight race ;
  if lowcase(height)=:'height' then height=left(substr(height,7));
  if lowcase(weight)=:'weight' then weight=left(substr(weight,7));
  if lowcase(race)=:'race' then race=left(substr(race,5));
cards4;
daniel - height 72 inches, weight 250 pounds;race african american
jack - height 60 inches, weight 150 pounds,race Caucasian
Lee - height 75 inches, weight 175 pounds,race mixed
;;;;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 343px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16661i436BA6BC11036398/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 06:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413898#M101362</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-11-16T06:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: reading ; (semicolon) and , (comma) in the date and  How to output in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413958#M101383</link>
      <description>&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I have to clean this data and put it back as csv file. The first one works alright for me. Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 11:47:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-semicolon-and-comma-in-the-date-and-How-to-output-in-csv/m-p/413958#M101383</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2017-11-16T11:47:32Z</dc:date>
    </item>
  </channel>
</rss>

