<?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: scan function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/scan-function/m-p/342633#M78563</link>
    <description>&lt;P&gt;If the "test" code doesn't include any external file references I would suggest that you start first by running the code as provided in the test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the question code as posted&amp;nbsp;all of the answers are wrong unless you consider an empty dataset as "missing character value" as the code will not run at all.&amp;nbsp;You&amp;nbsp;are missng a&amp;nbsp;; at the end of line two.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Mar 2017 15:13:16 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-03-20T15:13:16Z</dc:date>
    <item>
      <title>scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scan-function/m-p/342288#M78480</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My question is the code like,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data work.test;&lt;BR /&gt;title='A TALE OF TWO CITIES, CHARLES J. DICKENS'&lt;BR /&gt;WORD=SCAN(title,3,' ,');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;What is the value of word?&lt;BR /&gt;A. T&lt;BR /&gt;B. OF&lt;BR /&gt;C.DICKENS&lt;BR /&gt;D. ''MISSING CHARACTER VALUE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have run this code in sas like,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work1;&lt;BR /&gt;input title $ 1-39;&lt;BR /&gt;datalines;&lt;BR /&gt;A TALE OF TWO CITIES, CHARLES J. DICKENS&lt;BR /&gt;run;&lt;BR /&gt;data work1;&lt;BR /&gt;WORD=SCAN(title,3,' ,');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And i got log message like,&lt;/P&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;61&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;62 data work1;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;63 input title $ 1-39;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;64 datalines;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The data set WORK.WORK1 has 1 observations and 1 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.01 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.01 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;66 WORD=SCAN(title,3);&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;66 WORD=SCAN(title,3);&lt;/DIV&gt;&lt;DIV class="sasError"&gt;____&lt;/DIV&gt;&lt;DIV class="sasError"&gt;180&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;67 run;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;68 data work1;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;69 WORD=SCAN(title,3,' ,');&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;70 run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;69:11&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Variable title is uninitialized.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The data set WORK.WORK1 has 1 observations and 2 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;71&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;72 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;85&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So,&lt;/P&gt;&lt;P&gt;What will be the answer comes? As my logic answer sholde be missing character value!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2017 22:36:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scan-function/m-p/342288#M78480</guid>
      <dc:creator>margi123</dc:creator>
      <dc:date>2017-03-18T22:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scan-function/m-p/342290#M78482</link>
      <description>&lt;P&gt;You didn't include a set statement in your second datastep. e.g.&lt;/P&gt;
&lt;PRE&gt;data work1;
input title $ 1-39;
datalines;
A TALE OF TWO CITIES, CHARLES J. DICKENS
run;

data work1;
  set work1;
WORD=SCAN(title,3,' ,');
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2017 22:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scan-function/m-p/342290#M78482</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-18T22:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scan-function/m-p/342292#M78484</link>
      <description>You must put ";" after every program line. Please&lt;BR /&gt;Put ";" sign after line below and try again :&lt;BR /&gt;&lt;BR /&gt;title='A TALE OF TWO CITIES, CHARLES J. DICKENS';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 18 Mar 2017 22:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scan-function/m-p/342292#M78484</guid>
      <dc:creator>Yavuz</dc:creator>
      <dc:date>2017-03-18T22:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scan-function/m-p/342633#M78563</link>
      <description>&lt;P&gt;If the "test" code doesn't include any external file references I would suggest that you start first by running the code as provided in the test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the question code as posted&amp;nbsp;all of the answers are wrong unless you consider an empty dataset as "missing character value" as the code will not run at all.&amp;nbsp;You&amp;nbsp;are missng a&amp;nbsp;; at the end of line two.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 15:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scan-function/m-p/342633#M78563</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-20T15:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scan-function/m-p/379319#M91299</link>
      <description>&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; title $ &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;55&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;A TALE OF TWO CITIES, CHARLES J. DICKENS&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;WORD=SCAN(title,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;' ,'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 10:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scan-function/m-p/379319#M91299</guid>
      <dc:creator>Saidurga1</dc:creator>
      <dc:date>2017-07-26T10:19:59Z</dc:date>
    </item>
  </channel>
</rss>

