<?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: import cv file with numeric comma separator decimal in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446261#M111948</link>
    <description>&lt;P&gt;Thanks TOM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;by using your proposed solution. I succeed to load the 2 first col but the rate is not loaded and I get a warning "&lt;/P&gt;&lt;P&gt;Invalid data for RATE&lt;/P&gt;</description>
    <pubDate>Fri, 16 Mar 2018 17:01:03 GMT</pubDate>
    <dc:creator>Nasser_DRMCP</dc:creator>
    <dc:date>2018-03-16T17:01:03Z</dc:date>
    <item>
      <title>import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446240#M111932</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a csv file that holds rates values like 0,04715 or 0,0428. ',' is the decimal separator.&lt;/P&gt;&lt;P&gt;When I load the data by using proc import , the numbers are 4,715 and 428.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Maybe I should do this by using "data ...infile..." but I tried and I did not succed to get the data.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;many thanks in advance for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nasser&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 16:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446240#M111932</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-03-16T16:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446245#M111935</link>
      <description>&lt;P&gt;It may help us if you open the CSV file with a text editor such as&amp;nbsp;Notepad or even the SAS Editor &amp;nbsp;(NOT any spreadsheet) and then paste 2 or 3 lines of the data into a code box opened using the forums {I} menu icon. I recommend this box as the main message window will reformat text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any sensitive data within that example the replace values as appropriate such as names with XXXX or YYYY and any numeric with something of a similar pattern but with something generic.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 16:14:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446245#M111935</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-16T16:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446246#M111936</link>
      <description>&lt;PRE&gt;COL1;YEARMONTH;RATE
XXXX;201709;0,04715
XXXX;201710;0,04477
XXXX;201711;0,04477
XXXX;201712;0,04477
XXXX;201801;0,0428
XXXX;201802;0,0428
XXXX;201803;0,0428
XXXX;201804;0,0413&lt;/PRE&gt;&lt;P&gt;Thanks Ballardw. I copied 8 lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 16:20:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446246#M111936</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-03-16T16:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446250#M111939</link>
      <description>&lt;P&gt;No need to use PROC IMPORT for a file with only three columns.&lt;/P&gt;
&lt;P&gt;Use the COMMAX informat to let SAS know to swap the decimal and thousands separators.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  infile 'myfile.txt' dsd dlm=';' truncover firstobs=2;
  input COL1 :$20. YEARMONTH_char :$6. RATE :commax. ;
  YEARMONTH= input(yearmonth_char||'01',yymmdd8.);
   format yearmonth yymmn6. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Mar 2018 16:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446250#M111939</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-16T16:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446261#M111948</link>
      <description>&lt;P&gt;Thanks TOM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;by using your proposed solution. I succeed to load the 2 first col but the rate is not loaded and I get a warning "&lt;/P&gt;&lt;P&gt;Invalid data for RATE&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 17:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446261#M111948</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-03-16T17:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446262#M111949</link>
      <description>&lt;P&gt;Can you post the full error from the log, including the line it had the issue with?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 17:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446262#M111949</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-16T17:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446265#M111950</link>
      <description>&lt;P&gt;Check your end of line characters.&lt;/P&gt;
&lt;P&gt;Read a few records from the file in fixed block mode and check what hex codes are at the end of the lines.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile 'myfile.txt' recfm=f lrecl=100 obs=3 ;
  input;
  list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It might be that you have '0D0A'x at the end of the line and SAS is assuming you are on Unix and expects only '0A'x to mark the end of the line. So the '0D'x becomes part of the data and is an invalid character for a numeric value.&lt;/P&gt;
&lt;P&gt;Try adding TERMSTR=CRLF to your infile statement.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 17:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446265#M111950</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-16T17:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446291#M111953</link>
      <description>&lt;P&gt;Depending on your LOCALE setting you might need to use COMMA informat instead of COMMAX.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 17:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446291#M111953</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-16T17:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446693#M112117</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to all for your quick responses.&lt;/P&gt;&lt;P&gt;As suggested by Tom, by specifying &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TERMSTR&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=CRLF, then It works.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;regards&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Nasser&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 08:14:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446693#M112117</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-03-19T08:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446696#M112118</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have subsidiary question. I have 20 columns like RATE_1_... RATE_2_... RATE_3...RATE_20&lt;/P&gt;&lt;P&gt;Is it possible to specify :commax.&amp;nbsp;for all columns begins with RATE_ ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for a column that contains dates like 01/01/2015, I specify :ddmmyy10. but "20089" is loaded ! what is the adequat format ?&lt;/P&gt;&lt;P&gt;thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nasser&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 08:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446696#M112118</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-03-19T08:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446698#M112119</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I succeed to load the date by specifying&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; PERIODE &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Nasser&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 08:55:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446698#M112119</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-03-19T08:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446705#M112125</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found the solution for multple columns. the syntax in the input statement is below&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;(RATE_2007-RATE_2021) (&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;15&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;*:&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;commax.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Nasser&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 10:10:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446705#M112125</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-03-19T10:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: import cv file with numeric comma separator decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446763#M112147</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found the solution for multple columns. the syntax in the input statement is below&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;(RATE_2007-RATE_2021) (&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;15&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;*:&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;commax.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Nasser&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Right.&amp;nbsp; Note that you don't need the 15* as SAS will automatically recycle the list of informats (or formats) when it is shorter than the list of variables.&amp;nbsp; You could also remove the informat specifications from the INPUT statement and instead add an INFORMAT statement.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 13:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-cv-file-with-numeric-comma-separator-decimal/m-p/446763#M112147</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-19T13:31:47Z</dc:date>
    </item>
  </channel>
</rss>

