<?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 Scan in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Scan/m-p/19639#M4007</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm am reletively new to SAS and i am trying to write some code to split up a character string and import it into a table. Most of what i have done works ok but i am having problems with the following:&lt;BR /&gt;
&lt;BR /&gt;
Username  = scan(_blob_,1,",")&lt;BR /&gt;
Balance  = scan(_blob_,2,",");&lt;BR /&gt;
Pending_bonus_balance  = scan(_blob_,3,",");&lt;BR /&gt;
Bonus_balance  =  scan(_blob_,4,",");&lt;BR /&gt;
Total_bonus  =  scan(_blob_,5,",");&lt;BR /&gt;
Poker_nickname = scan(_blob_,6,",");&lt;BR /&gt;
Has_played_poker_download  =  scan(_blob_,7,",");&lt;BR /&gt;
Last_bonus  =  scan(_blob_,8,",");&lt;BR /&gt;
Last_bonus_date  =  scan(_blob_,9,",");&lt;BR /&gt;
Poker_rakes  =  scan(_blob_,10,",");&lt;BR /&gt;
&lt;BR /&gt;
The file that i am reading from contains a few thousend rows like this:&lt;BR /&gt;
NUMERATOR,0,0,0,849.4,Numerator,1,0,,4040.364404&lt;BR /&gt;
HIPPO,91.94,0,0,,FantasticHippo,1,0,,133.1472401&lt;BR /&gt;
TECHALL,0,0,0,,Techall,1,0,,3.13005324&lt;BR /&gt;
QUILLIUS,0,0,0,,quillius,1,0,,118.7320193&lt;BR /&gt;
&lt;BR /&gt;
The problem comes when its gets to the ,, fields. It ignores the fact that it is empty and just pushes everything along one column. I have tried writing IF statements to fill the empty cells but that did not help. &lt;BR /&gt;
&lt;BR /&gt;
Help anyone?&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
    <pubDate>Wed, 21 May 2008 12:30:49 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-05-21T12:30:49Z</dc:date>
    <item>
      <title>Scan</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Scan/m-p/19639#M4007</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm am reletively new to SAS and i am trying to write some code to split up a character string and import it into a table. Most of what i have done works ok but i am having problems with the following:&lt;BR /&gt;
&lt;BR /&gt;
Username  = scan(_blob_,1,",")&lt;BR /&gt;
Balance  = scan(_blob_,2,",");&lt;BR /&gt;
Pending_bonus_balance  = scan(_blob_,3,",");&lt;BR /&gt;
Bonus_balance  =  scan(_blob_,4,",");&lt;BR /&gt;
Total_bonus  =  scan(_blob_,5,",");&lt;BR /&gt;
Poker_nickname = scan(_blob_,6,",");&lt;BR /&gt;
Has_played_poker_download  =  scan(_blob_,7,",");&lt;BR /&gt;
Last_bonus  =  scan(_blob_,8,",");&lt;BR /&gt;
Last_bonus_date  =  scan(_blob_,9,",");&lt;BR /&gt;
Poker_rakes  =  scan(_blob_,10,",");&lt;BR /&gt;
&lt;BR /&gt;
The file that i am reading from contains a few thousend rows like this:&lt;BR /&gt;
NUMERATOR,0,0,0,849.4,Numerator,1,0,,4040.364404&lt;BR /&gt;
HIPPO,91.94,0,0,,FantasticHippo,1,0,,133.1472401&lt;BR /&gt;
TECHALL,0,0,0,,Techall,1,0,,3.13005324&lt;BR /&gt;
QUILLIUS,0,0,0,,quillius,1,0,,118.7320193&lt;BR /&gt;
&lt;BR /&gt;
The problem comes when its gets to the ,, fields. It ignores the fact that it is empty and just pushes everything along one column. I have tried writing IF statements to fill the empty cells but that did not help. &lt;BR /&gt;
&lt;BR /&gt;
Help anyone?&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Wed, 21 May 2008 12:30:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Scan/m-p/19639#M4007</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-21T12:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Scan</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Scan/m-p/19640#M4008</link>
      <description>instead of SCAN() it sounds like you want to look at how the INFILE and INPUT statements can help you. A very significant feature is the DSD option of the INFILE statement&lt;BR /&gt;
&lt;BR /&gt;
good luck&lt;BR /&gt;
&lt;BR /&gt;
PeterC</description>
      <pubDate>Wed, 21 May 2008 12:52:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Scan/m-p/19640#M4008</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-21T12:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Scan</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Scan/m-p/19641#M4009</link>
      <description>Welcome to the wonderful (full of wonder) rich world of SAS and SAS programming.&lt;BR /&gt;
SAS was originally written for non-programmers, so there is generally an easy or easier way of doing things.&lt;BR /&gt;
&lt;BR /&gt;
You are doing this the hard way.&lt;BR /&gt;
&lt;BR /&gt;
The easy way is&lt;BR /&gt;
[pre]&lt;BR /&gt;
DATA captured;&lt;BR /&gt;
  INFILE indata delimiter=',' dsd;&lt;BR /&gt;
&lt;BR /&gt;
  INPUT Username balance pending_bonus_balance total_bonus poker_nickname has_played_poker_download last_bonus last_bonus_date poker_rates;&lt;BR /&gt;
RUN;&lt;BR /&gt;
QUIT;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
This code example is not perfect, I haven't tested it.&lt;BR /&gt;
Find the Web online documentation for BaseSAS for 9.1.x or your version of SAS and begin reading.&lt;BR /&gt;
&lt;BR /&gt;
SAS is not your normal programming language.  It is data centric and meant to simplify the programming process of reading data in, processing the data, and reporting on the results of the processing.  It is very rich in features, it is so extensive, I expect no one knows all of it in complete detail.</description>
      <pubDate>Wed, 21 May 2008 12:53:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Scan/m-p/19641#M4009</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-21T12:53:58Z</dc:date>
    </item>
  </channel>
</rss>

