<?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: Read comma separated values with extra commas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19373#M2989</link>
    <description>Yes, there is an option. M&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data a;&lt;BR /&gt;
   retain dlm ',';&lt;BR /&gt;
   infile cards dsd dlm=dlm;&lt;BR /&gt;
   input @;&lt;BR /&gt;
   call scan(_infile_,2,start,_n_,dlm,'M');&lt;BR /&gt;
   call scan(_infile_,-10,end,_n_,dlm,'M');&lt;BR /&gt;
   length = end-start-1;&lt;BR /&gt;
   put start= end=;&lt;BR /&gt;
&lt;BR /&gt;
   input id:$25. field2 $varying50. length +1 (field3-field10)(:) field11:$10.;&lt;BR /&gt;
   list;&lt;BR /&gt;
   *CALL SCAN(&lt;STRING&gt;, count, position, length &amp;lt;, &lt;CHARLIST&gt; &amp;lt;, &lt;MODIFIER&gt;); &lt;BR /&gt;
   datalines;&lt;BR /&gt;
20308810700000020292,some text 5,0,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client 1,&lt;BR /&gt;
20308810000000020293,some,t,ex,t 2,0,6991.53,,0.00,0.00,6991.53,0.00,0,client2,&lt;BR /&gt;
20308810300000020294,some text 3,1,6991.53,0.00,0.00,,,0.00,0,client 3,&lt;BR /&gt;
20308810600000020936,so,me,text,4,0,13440.68,0.00,0.00,0.00,13440.68,0.00,0,client 4,&lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]

Message was edited by: data _null_;&lt;/MODIFIER&gt;&lt;/CHARLIST&gt;&lt;/STRING&gt;</description>
    <pubDate>Wed, 02 Mar 2011 11:52:40 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2011-03-02T11:52:40Z</dc:date>
    <item>
      <title>Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19367#M2983</link>
      <description>Hello SAS-users.&lt;BR /&gt;
  I need to read comma delimited file into SAS dataset.&lt;BR /&gt;
  The second character variable "account_name" can contain extra commas &lt;BR /&gt;
  and the next variable "var1" always have values "0" and "1".&lt;BR /&gt;
  My solution is below. But it seems to me a bit awkward.&lt;BR /&gt;
  Could you please suggest something else?&lt;BR /&gt;
  Thanks in advance.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
  data test1 ;&lt;BR /&gt;
  infile datalines    truncover dsd;&lt;BR /&gt;
  length account $20. account_name $20. var1 $10.  ss_ostd 8. ss_ostc 8. ost_ccy 8. client $10.;&lt;BR /&gt;
  input ;&lt;BR /&gt;
  account=left(scan(_infile_,1,','));&lt;BR /&gt;
  if length(account)=20 then do;&lt;BR /&gt;
  account_name=scan(_infile_,2,',');&lt;BR /&gt;
  var1=trim(left(scan(_infile_,3,',')));&lt;BR /&gt;
  k=4;&lt;BR /&gt;
  do while (trim(left(var1)) not in ('0' '1'));&lt;BR /&gt;
  account_name=trim(account_name)||var1;&lt;BR /&gt;
  var1=trim(left(scan(_infile_,k,',')));&lt;BR /&gt;
  k=k+1;&lt;BR /&gt;
  end;&lt;BR /&gt;
  ss_ostd=input(left(scan(_infile_,k+4,',')),17.);&lt;BR /&gt;
  ss_ostc=input(left(scan(_infile_,k+5,',')),17.);&lt;BR /&gt;
  ost_ccy=input(left(scan(_infile_,k+6,',')),17.);&lt;BR /&gt;
  client=left(scan(_infile_,k+7,','));&lt;BR /&gt;
  end; else delete;&lt;BR /&gt;
  drop  k ;&lt;BR /&gt;
  datalines;&lt;BR /&gt;
20308810700000020292,some text 5,0,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client 1,&lt;BR /&gt;
20308810000000020293,some,t,ex,t 2,0,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client2,&lt;BR /&gt;
20308810300000020294,some text 3,1,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client 3,&lt;BR /&gt;
20308810600000020936,so,me,text,4,0,13440.68,0.00,0.00,0.00,13440.68,0.00,0,client 4,&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]</description>
      <pubDate>Tue, 01 Mar 2011 16:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19367#M2983</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2011-03-01T16:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19368#M2984</link>
      <description>Thats interesting.. Let me work on it..

Message was edited by: Ravi Mantripragada</description>
      <pubDate>Tue, 01 Mar 2011 16:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19368#M2984</guid>
      <dc:creator>SAS83</dc:creator>
      <dc:date>2011-03-01T16:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19369#M2985</link>
      <description>IFF you KNOW how many fields there are following the pesky field.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data a;&lt;BR /&gt;
   length dlm $1;&lt;BR /&gt;
   dlm = ',';&lt;BR /&gt;
   infile cards dsd dlm=dlm;&lt;BR /&gt;
   input @;&lt;BR /&gt;
   call scan(_infile_,2,start,_n_,',');&lt;BR /&gt;
   call scan(_infile_,-10,end,_n_,',');&lt;BR /&gt;
   length = end-start-1;&lt;BR /&gt;
   put start= end=;&lt;BR /&gt;
&lt;BR /&gt;
   input id:$25. field2 $varying50. length +1 (field3-field11)(:$10.);&lt;BR /&gt;
   list;&lt;BR /&gt;
   *CALL SCAN(&lt;STRING&gt;, count, position, length &amp;lt;, &lt;CHARLIST&gt; &amp;lt;, &lt;MODIFIER&gt;); &lt;BR /&gt;
datalines;&lt;BR /&gt;
20308810700000020292,some text 5,0,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client 1,&lt;BR /&gt;
20308810000000020293,some,t,ex,t 2,0,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client2,&lt;BR /&gt;
20308810300000020294,some text 3,1,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client 3,&lt;BR /&gt;
20308810600000020936,so,me,text,4,0,13440.68,0.00,0.00,0.00,13440.68,0.00,0,client 4,&lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
                                                      The SAS System                       09:02 Tuesday, March 1, 2011  11&lt;BR /&gt;
&lt;BR /&gt;
                                                                                                         f     f&lt;BR /&gt;
                  l                              f        f     f       f     f     f       f       f    i     i&lt;BR /&gt;
          s       e                              i        i     i       i     i     i       i       i    e     e&lt;BR /&gt;
          t       n                              e        e     e       e     e     e       e       e    l     l&lt;BR /&gt;
      O   a   e   g                              l        l     l       l     l     l       l       l    d     d&lt;BR /&gt;
      b   r   n   t           i                  d        d     d       d     d     d       d       d    1     1&lt;BR /&gt;
      s   t   d   h           d                  2        3     4       5     6     7       8       9    0     1&lt;BR /&gt;
&lt;BR /&gt;
      1  22  34  11  20308810700000020292  some text 5    0  6991.53   0.00  0.00  0.00  6991.53   0.00  0  client 1&lt;BR /&gt;
      2  22  36  13  20308810000000020293  some,t,ex,t 2  0  6991.53   0.00  0.00  0.00  6991.53   0.00  0  client2&lt;BR /&gt;
      3  22  34  11  20308810300000020294  some text 3    1  6991.53   0.00  0.00  0.00  6991.53   0.00  0  client 3&lt;BR /&gt;
      4  22  35  12  20308810600000020936  so,me,text,4   0  13440.68  0.00  0.00  0.00  13440.68  0.00  0  client 4&lt;BR /&gt;
[/pre]&lt;/MODIFIER&gt;&lt;/CHARLIST&gt;&lt;/STRING&gt;</description>
      <pubDate>Tue, 01 Mar 2011 18:29:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19369#M2985</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-03-01T18:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19370#M2986</link>
      <description>Thank you _null_.&lt;BR /&gt;
&lt;BR /&gt;
I always learn a lot from your posts here.&lt;BR /&gt;
&lt;BR /&gt;
Oleg.</description>
      <pubDate>Wed, 02 Mar 2011 06:35:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19370#M2986</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2011-03-02T06:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19371#M2987</link>
      <description>There are some difficulties with call scan and my actual data.&lt;BR /&gt;
&lt;BR /&gt;
If two or more contiguous delimiters exist, CALL SCAN treats them as one.&lt;BR /&gt;
&lt;BR /&gt;
Is it possible to solve this?</description>
      <pubDate>Wed, 02 Mar 2011 09:00:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19371#M2987</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2011-03-02T09:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19372#M2988</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
Another solution which takes advantage of the reverse function and format:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data test1 ;&lt;BR /&gt;
infile datalines  truncover dsd;&lt;BR /&gt;
&lt;BR /&gt;
input account :$20. @;&lt;BR /&gt;
call scan(_infile_,2,position,length,',');&lt;BR /&gt;
&lt;BR /&gt;
_infile_=reverse(trim(substr(_infile_,position)));&lt;BR /&gt;
&lt;BR /&gt;
input @2 client :$10. ost_ccy_ $ ss_ostc_ $ ss_ostd_ $ d1 d2 d3 d4 var1 account_name &amp;amp; :$20. ;&lt;BR /&gt;
&lt;BR /&gt;
ost_ccy=input(put(ost_ccy_,$revers8.),8.);&lt;BR /&gt;
ss_ostc=input(put(ss_ostc_,$revers8.),8.);&lt;BR /&gt;
ss_ostd=input(put(ss_ostd_,$revers8.),8.);&lt;BR /&gt;
&lt;BR /&gt;
format client $revers10. account_name $revers20.;&lt;BR /&gt;
drop d: position length ost_ccy_ ss_ostc_ ss_ostd_;&lt;BR /&gt;
&lt;BR /&gt;
datalines;&lt;BR /&gt;
20308810700000020292,some text 5,0,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client 1,&lt;BR /&gt;
20308810000000020293,some,t,ex,t 2,0,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client2,&lt;BR /&gt;
20308810300000020294,some text 3,1,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client 3,&lt;BR /&gt;
20308810600000020936,so,me,text,4,0,13440.68,0.00,0.00,0.00,13440.68,0.00,0,client 4,&lt;BR /&gt;
;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Marius</description>
      <pubDate>Wed, 02 Mar 2011 10:09:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19372#M2988</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-02T10:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19373#M2989</link>
      <description>Yes, there is an option. M&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data a;&lt;BR /&gt;
   retain dlm ',';&lt;BR /&gt;
   infile cards dsd dlm=dlm;&lt;BR /&gt;
   input @;&lt;BR /&gt;
   call scan(_infile_,2,start,_n_,dlm,'M');&lt;BR /&gt;
   call scan(_infile_,-10,end,_n_,dlm,'M');&lt;BR /&gt;
   length = end-start-1;&lt;BR /&gt;
   put start= end=;&lt;BR /&gt;
&lt;BR /&gt;
   input id:$25. field2 $varying50. length +1 (field3-field10)(:) field11:$10.;&lt;BR /&gt;
   list;&lt;BR /&gt;
   *CALL SCAN(&lt;STRING&gt;, count, position, length &amp;lt;, &lt;CHARLIST&gt; &amp;lt;, &lt;MODIFIER&gt;); &lt;BR /&gt;
   datalines;&lt;BR /&gt;
20308810700000020292,some text 5,0,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client 1,&lt;BR /&gt;
20308810000000020293,some,t,ex,t 2,0,6991.53,,0.00,0.00,6991.53,0.00,0,client2,&lt;BR /&gt;
20308810300000020294,some text 3,1,6991.53,0.00,0.00,,,0.00,0,client 3,&lt;BR /&gt;
20308810600000020936,so,me,text,4,0,13440.68,0.00,0.00,0.00,13440.68,0.00,0,client 4,&lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]

Message was edited by: data _null_;&lt;/MODIFIER&gt;&lt;/CHARLIST&gt;&lt;/STRING&gt;</description>
      <pubDate>Wed, 02 Mar 2011 11:52:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19373#M2989</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-03-02T11:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19374#M2990</link>
      <description>Thank you Marius.&lt;BR /&gt;
Your solution works on my actual data except few cases when the string contains embedded blank before extra comma. But this imperfection is not important and I can continue to work on my task.&lt;BR /&gt;
See record 2 below for example.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
data test1 ;&lt;BR /&gt;
infile datalines  truncover dsd;&lt;BR /&gt;
&lt;BR /&gt;
input account :$20. @;&lt;BR /&gt;
call scan(_infile_,2,position,length,',');&lt;BR /&gt;
&lt;BR /&gt;
_infile_=reverse(trim(substr(_infile_,position)));&lt;BR /&gt;
&lt;BR /&gt;
input @2 client :$10. ost_ccy_ $ ss_ostc_ $ ss_ostd_ $ d1 :$1. d2 :$1. d3 :$1. d4 :$1. var1 :$1.  account_name &amp;amp; :$20. ;&lt;BR /&gt;
&lt;BR /&gt;
ost_ccy=input(put(ost_ccy_,$revers8.),8.);&lt;BR /&gt;
ss_ostc=input(put(ss_ostc_,$revers8.),8.);&lt;BR /&gt;
ss_ostd=input(put(ss_ostd_,$revers8.),8.);&lt;BR /&gt;
&lt;BR /&gt;
format client $revers10. account_name $revers20.;&lt;BR /&gt;
drop d: position length ost_ccy_ ss_ostc_ ss_ostd_;&lt;BR /&gt;
&lt;BR /&gt;
datalines;&lt;BR /&gt;
20308810700000020292,some text 5,0,6991.53,0.00,0.00,0.00,6991.53,0.00,0,,&lt;BR /&gt;
20308810000000020293,some,t,ex ,t 2,0,6991.53,,0.00,0.00,6991.53,0.00,0,client2,&lt;BR /&gt;
20308810300000020294,some text 3,1,6991.53,,0.00,0.00,6991.53,0.00,0,client 3,&lt;BR /&gt;
20308810600000020936,so,me,text,4,0,13440.68,0.00,0.00,0.00,13440.68,0.00,0,,&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 02 Mar 2011 13:29:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19374#M2990</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2011-03-02T13:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19375#M2991</link>
      <description>Thank you _null_.&lt;BR /&gt;
I use SAS 9.1.3. There are no options.</description>
      <pubDate>Wed, 02 Mar 2011 13:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19375#M2991</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2011-03-02T13:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19376#M2992</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P&gt;ok, then switch the way account_name is read from list input to formatted input  and it should be ok:&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
account_name &amp;amp; :$20. switched to  &lt;B&gt;account_name $20.&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P&gt;Marius&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2011 14:10:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19376#M2992</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-02T14:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19377#M2993</link>
      <description>Thank you very much.&lt;BR /&gt;
It's perfect now.&lt;BR /&gt;
&lt;BR /&gt;
Oleg</description>
      <pubDate>Wed, 02 Mar 2011 14:21:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19377#M2993</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2011-03-02T14:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19378#M2994</link>
      <description>There are always options.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data a;&lt;BR /&gt;
   retain dlm ',';&lt;BR /&gt;
   infile cards dsd dlm=dlm;&lt;BR /&gt;
   input @;&lt;BR /&gt;
   end = length(_infile_)+1;&lt;BR /&gt;
   do j = 1 to 10;&lt;BR /&gt;
      end = find(_infile_,',',-(end-1));&lt;BR /&gt;
      end;&lt;BR /&gt;
   start = find(_infile_,dlm,1);&lt;BR /&gt;
   length = end-start-1;&lt;BR /&gt;
   input id:$25. field2 $varying50. length +1 (field3-field10)(:) field11:$10.;&lt;BR /&gt;
   list;&lt;BR /&gt;
   *CALL SCAN(&lt;STRING&gt;, count, position, length &amp;lt;, &lt;CHARLIST&gt; &amp;lt;, &lt;MODIFIER&gt;); &lt;BR /&gt;
   datalines;&lt;BR /&gt;
20308810700000020292,some text 5,0,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client 1,&lt;BR /&gt;
20308810000000020293,some,t,ex,t 2,0,6991.53,,0.00,0.00,6991.53,0.00,0,client2,&lt;BR /&gt;
20308810300000020294,some text 3,1,6991.53,0.00,0.00,,,0.00,0,client 3,&lt;BR /&gt;
20308810600000020936,so,me,text,4,0,13440.68,0.00,0.00,0.00,13440.68,0.00,0,client 4,&lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]&lt;/MODIFIER&gt;&lt;/CHARLIST&gt;&lt;/STRING&gt;</description>
      <pubDate>Wed, 02 Mar 2011 14:44:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19378#M2994</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-03-02T14:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19379#M2995</link>
      <description>Thank you _null_.&lt;BR /&gt;
It works.&lt;BR /&gt;
I admire your coding skill last three years.&lt;BR /&gt;
&lt;BR /&gt;
Oleg.</description>
      <pubDate>Wed, 02 Mar 2011 15:55:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19379#M2995</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2011-03-02T15:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19380#M2996</link>
      <description>I also think a while.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data test1 (drop=zero one dif first_pos end_pos);&lt;BR /&gt;
infile datalines  length=len;&lt;BR /&gt;
input  whole $varying200. len;&lt;BR /&gt;
zero=find(whole,',0,');&lt;BR /&gt;
one=find(whole,',1,');&lt;BR /&gt;
if zero and one then end_pos=min(zero,one);&lt;BR /&gt;
  else end_pos=max(zero,one);&lt;BR /&gt;
  first_pos=findc(whole,',')+1;&lt;BR /&gt;
  dif=end_pos - first_pos;&lt;BR /&gt;
 account=scan(whole,1,',');&lt;BR /&gt;
 account_name=substr(whole,first_pos,dif);&lt;BR /&gt;
 client=scan(strip(whole),-1,',');&lt;BR /&gt;
&lt;BR /&gt;
datalines;&lt;BR /&gt;
20308810700000020292,some text 5,0,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client 1,&lt;BR /&gt;
20308810000000020293,some,t,ex,t 2,0,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client2,&lt;BR /&gt;
20308810300000020294,some text 3,1,6991.53,0.00,0.00,0.00,6991.53,0.00,0,client 3,&lt;BR /&gt;
20308810600000020936,so,me,text,4,0,13440.68,0.00,0.00,0.00,13440.68,0.00,0,client 4,&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Thu, 03 Mar 2011 09:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19380#M2996</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-03-03T09:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Read comma separated values with extra commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19381#M2997</link>
      <description>Thank you for the new approach to my problem.&lt;BR /&gt;
&lt;BR /&gt;
SAS soft supports our lifes.&lt;BR /&gt;
&lt;BR /&gt;
Oleg.</description>
      <pubDate>Thu, 03 Mar 2011 11:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-comma-separated-values-with-extra-commas/m-p/19381#M2997</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2011-03-03T11:37:41Z</dc:date>
    </item>
  </channel>
</rss>

