<?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: Problem regarding scan with negative number? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-scan-with-negative-number/m-p/731211#M227778</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212695"&gt;@Phil_NZ&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue with answer&amp;nbsp;&lt;STRONG&gt;b&lt;/STRONG&gt; is that it uses all default delimiters, i.e., including the blank, which results in &lt;FONT face="courier new,courier"&gt;Country='Zealand'&lt;/FONT&gt; for observation no. 3. (&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_blank" rel="noopener"&gt;Maxim 4: Try it.&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, answer &lt;STRONG&gt;c&lt;/STRONG&gt; is not ideal either: Without using the 'R' modifier it leaves a leading blank in variable &lt;FONT face="courier new,courier"&gt;Country&lt;/FONT&gt; because a blank follows the comma (i.e., the &lt;EM&gt;only&lt;/EM&gt; word delimiter used) in &lt;FONT face="courier new,courier"&gt;CityCountry&lt;/FONT&gt;. For HTML output (as shown in the screenshot) this doesn't matter, but, e.g., a WHERE condition &lt;FONT face="courier new,courier"&gt;Country='India'&lt;/FONT&gt; would fail.&lt;/P&gt;</description>
    <pubDate>Sun, 04 Apr 2021 09:14:52 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2021-04-04T09:14:52Z</dc:date>
    <item>
      <title>Problem regarding scan with negative number?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-scan-with-negative-number/m-p/731202#M227774</link>
      <description>&lt;P&gt;Hi all SAS Users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Today I answer wrongly the question below regarding &lt;STRONG&gt;scan&lt;/STRONG&gt; function&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_0-1617522693486.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56889iC621CB7EE552387E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_0-1617522693486.png" alt="Phil_NZ_0-1617522693486.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To me I still think b should be the correct answer. Because scan function accept the negative number to read from the right. I still do not think that the answer c is correct, because it is redundant, because',' is a default delimiter in SCAN function so we do not need to list it out .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I may fall in a fallacy but I cannot convince me myself the correct answer is c instead of b.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warmest regards and thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Apr 2021 07:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-scan-with-negative-number/m-p/731202#M227774</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-04-04T07:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem regarding scan with negative number?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-scan-with-negative-number/m-p/731211#M227778</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212695"&gt;@Phil_NZ&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue with answer&amp;nbsp;&lt;STRONG&gt;b&lt;/STRONG&gt; is that it uses all default delimiters, i.e., including the blank, which results in &lt;FONT face="courier new,courier"&gt;Country='Zealand'&lt;/FONT&gt; for observation no. 3. (&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_blank" rel="noopener"&gt;Maxim 4: Try it.&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, answer &lt;STRONG&gt;c&lt;/STRONG&gt; is not ideal either: Without using the 'R' modifier it leaves a leading blank in variable &lt;FONT face="courier new,courier"&gt;Country&lt;/FONT&gt; because a blank follows the comma (i.e., the &lt;EM&gt;only&lt;/EM&gt; word delimiter used) in &lt;FONT face="courier new,courier"&gt;CityCountry&lt;/FONT&gt;. For HTML output (as shown in the screenshot) this doesn't matter, but, e.g., a WHERE condition &lt;FONT face="courier new,courier"&gt;Country='India'&lt;/FONT&gt; would fail.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Apr 2021 09:14:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-scan-with-negative-number/m-p/731211#M227778</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-04-04T09:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem regarding scan with negative number?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-scan-with-negative-number/m-p/731214#M227780</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see the case 'Zealand' ,it makes total sense to me now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm regards.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Apr 2021 09:36:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-regarding-scan-with-negative-number/m-p/731214#M227780</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-04-04T09:36:54Z</dc:date>
    </item>
  </channel>
</rss>

