<?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 Reading csv with currency in data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82199#M288554</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Need to read this data from CSV problem here is while reading as dlm =',' after $ amount it is delimiting how to read it tried with dollar8. and comma formats but no luck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1,$2,000,abc,&lt;/P&gt;&lt;P&gt;2,$5,00,000,xyz,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Mar 2013 17:41:58 GMT</pubDate>
    <dc:creator>BobyGadu</dc:creator>
    <dc:date>2013-03-19T17:41:58Z</dc:date>
    <item>
      <title>Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82199#M288554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Need to read this data from CSV problem here is while reading as dlm =',' after $ amount it is delimiting how to read it tried with dollar8. and comma formats but no luck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1,$2,000,abc,&lt;/P&gt;&lt;P&gt;2,$5,00,000,xyz,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 17:41:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82199#M288554</guid>
      <dc:creator>BobyGadu</dc:creator>
      <dc:date>2013-03-19T17:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82200#M288555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this?&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;data want&lt;/TD&gt;&lt;TD&gt;;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;infile '&lt;STRONG&gt;your_path_to_csv_file.csv&lt;/STRONG&gt;' delimiter = ', '&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;MISSOVER DSD lrecl=32767 firstobs=2 ;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;informat&lt;/STRONG&gt; id best32. price dollar20.0 label $5. ;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;format&lt;/STRONG&gt; id best12.&amp;nbsp;&amp;nbsp; price dollar20.0 label $5. ;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;input id price label;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;run;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us know if this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 18:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82200#M288555</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-03-19T18:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82201#M288556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anca thank you for your reply but for price comma it is taking as delimited record cannot read reading into other field&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 19:06:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82201#M288556</guid>
      <dc:creator>BobyGadu</dc:creator>
      <dc:date>2013-03-19T19:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82202#M288557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm, I am reading a csv file with dollar amounts that include commas and it worked....(see the two attached files with csv and sas result)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11849iE830B5C3B90B9300/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="currency.bmp" title="currency.bmp" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11850iECD5FDA854084D18/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="sas_currency.bmp" title="sas_currency.bmp" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 19:11:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82202#M288557</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-03-19T19:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82203#M288558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try with txt with , delimiter &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 19:38:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82203#M288558</guid>
      <dc:creator>BobyGadu</dc:creator>
      <dc:date>2013-03-19T19:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82204#M288559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see. It doesn't work.&lt;/P&gt;&lt;P&gt;Can you open/save as your file as .CSV then run my initial code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":neutral_face:"&gt;😐&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 19:42:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82204#M288559</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-03-19T19:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82205#M288560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data is not in seperate cells in single column the data is seperated by ', ' I tried with csv &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 20:16:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82205#M288560</guid>
      <dc:creator>BobyGadu</dc:creator>
      <dc:date>2013-03-19T20:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82206#M288561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Best solution would be to fix the problem at the source.&amp;nbsp; Who ever generated that file should have put quotes around the values that included commas.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;1,"$2,000",abc,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;2,"$5,00,000",xyz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you fix the program that generates the CSV file?&lt;/P&gt;&lt;P&gt;If not the you need a strategy to fix the existing file.&amp;nbsp; You could look for a regular expression solution that could find match strings that look like dollar amounts and insert the quotes for you.&lt;/P&gt;&lt;P&gt;If your data is as simple as the example where there is only one field that has dollar amounts then you could use SCAN functions to parse the input record.&amp;nbsp; So you could scan from the left and from the right and whatever is left over is your dollar amount.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 20:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82206#M288561</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-03-19T20:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82207#M288562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hopefully, your example data's 2nd record was wrong and it was really supposed to contain $500,000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, and only have the 3 variables, and each line ends with a comma, you might be able to get away with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;data want&lt;/TD&gt;&lt;TD&gt;;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp; infile 'your_path_to_csv_file.csv' delimiter = ';'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MISSOVER DSD lrecl=32767 firstobs=1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informat id best32. price dollar20.0 label $5. ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format id best12.&amp;nbsp;&amp;nbsp; price dollar20.0 label $5. ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input @;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if count(_infile_,",") eq 3 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _infile_=translate(_infile_,";",",");&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(_infile_,find(_infile_,",",1),1)=";";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(_infile_,find(_infile_,",",-32767),1)=";";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(_infile_,find(_infile_,",",-32767),1)=";";&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input id price label;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 20:20:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82207#M288562</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-03-19T20:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82208#M288563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome it worked&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 20:30:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82208#M288563</guid>
      <dc:creator>BobyGadu</dc:creator>
      <dc:date>2013-03-19T20:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82209#M288564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 20:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82209#M288564</guid>
      <dc:creator>BobyGadu</dc:creator>
      <dc:date>2013-03-19T20:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82210#M288565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;had more fields&lt;/P&gt;&lt;P&gt;a,b,c,$amount,d,e,f,g,h,i&lt;/P&gt;&lt;P&gt;these many variables not just 3 how to handle these with these many variables please i didnt understood the _infile_ logic applied if it is having 3 variables are we taking count =3 or else any other logic and if variables increase means do we need to add mor substr logics &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 16:43:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82210#M288565</guid>
      <dc:creator>BobyGadu</dc:creator>
      <dc:date>2013-03-26T16:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82211#M288566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="2887" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: More info is needed in order to answer your question.&amp;nbsp; In your original example, only the 2nd field had data which could contain an embedded comma.&amp;nbsp; Do any of your additional fields have data that could contain embedded commas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_infile_, a system variable, is created the first time an input statement is encountered during an interatioin.&amp;nbsp; In the suggested code, an "input @;" statement is used to create _infile_, then _infile_ is modified to account for the possible embedded commas, and then a 2nd input statement is used to actually obtain the data from the modified _infile_ variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 17:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82211#M288566</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-03-26T17:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82212#M288567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a,b,c,$amount,d,e,f,g,h,i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a,b,c,$200,x,0.0%,xy,2 ab,sd,12.90%&lt;/P&gt;&lt;P&gt;z,c,d,$123,456,789,g,9.0%,aw,fr,78.78%&lt;/P&gt;&lt;P&gt;data looks like this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 17:35:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82212#M288567</guid>
      <dc:creator>BobyGadu</dc:creator>
      <dc:date>2013-03-26T17:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82213#M288568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="2887" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: You would really save yourself, and everyone here, quite a bit of time if you checked your posts a little more before sending.&amp;nbsp; You indicate having 10 fields, but only show nine in your data.&amp;nbsp; The following assumes that you only have the nine fields shown in your data and that, for record 1, "2 ab" was really supposed to be only 'ab'.&amp;nbsp; If you really have any space embedded data, you will have to add an &amp;amp; modifier in the input statement for those fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;data want&lt;/TD&gt;&lt;TD&gt;;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp; infile 'c:\art\your_path_to_csv_file.csv' delimiter = ';'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MISSOVER DSD lrecl=32767 firstobs=1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informat amount dollar20.0&lt;/P&gt;&lt;P&gt;&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; a b c d f g$5. &lt;/P&gt;&lt;P&gt;&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; e h percent12.2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format e h percent12.2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format amount dollar20.0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input @;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if count(_infile_,",") eq 9 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _infile_=translate(_infile_,";",",");&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do _n_=1 to 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(_infile_,find(_infile_,",",1),1)=";";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do _n_ = 1 to 5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(_infile_,find(_infile_,",",-32767),1)=";";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input a b c amount d e f g h;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 18:21:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82213#M288568</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-03-26T18:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82214#M288569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry about my data &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; but why are you specifically doing for first 3 records and first 5 records&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 19:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82214#M288569</guid>
      <dc:creator>BobyGadu</dc:creator>
      <dc:date>2013-03-26T19:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82215#M288570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It not the first three (and five) records but, rather, the first three variables and the last five variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is changing the commas to semicolons for all fields except the fourth one, the one that can contain embedded commas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then it is simply reading the record, using semicolons as the delimiter and only expecting to possibly confront commas when reading the fourth field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 19:03:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82215#M288570</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-03-26T19:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82216#M288571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you its gr8 function I ever came across thank you very much to learn about this &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 19:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82216#M288571</guid>
      <dc:creator>BobyGadu</dc:creator>
      <dc:date>2013-03-26T19:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82217#M288572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; dollar;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cards&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;dsd&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;column&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=col;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; (a b c)($) @;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; scan(_infile_,-&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;5&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;,p,l,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;','&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; l = p-col-&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; amv &lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;$varying32.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; l +&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; d $ e:&lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;percent.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; f $ g $ h :&lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;percent.&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cards&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffc0;"&gt;a,b,c,$200,x,0.0%,xy,sd,12.90%&lt;BR /&gt;z,c,d,$123,456,789,g,9.0%,aw,fr,78.78%&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;;;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 19:36:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82217#M288572</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-03-26T19:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reading csv with currency in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82218#M288573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may not have any control over the source of the CSV, but if you do and it comes out of Excel, you could request a tab delimited file as source instead.&amp;nbsp; This is just as easy to produce from Excel, and can be read with the standard Proc Import in SAS.&amp;nbsp; The advantages are:&amp;nbsp; commas in the value are no longer a problem, no non standard code to maintain, and any additional columns which might be introduced into the data will be dealt with automatically. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also advocate use of the comma informat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Mar 2013 05:53:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-csv-with-currency-in-data/m-p/82218#M288573</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2013-03-27T05:53:26Z</dc:date>
    </item>
  </channel>
</rss>

