<?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: Call Scan Function Error with Substring in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525816#M143089</link>
    <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w;
k='Pre-Dose 2';
/*call scan(k, -1, pos, length) ;*/
want=upcase(substr(k,1,length(k)-2));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 09 Jan 2019 18:50:59 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-01-09T18:50:59Z</dc:date>
    <item>
      <title>Call Scan Function Error with Substring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525812#M143087</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using call scan to substring a variable to remove the last number from the string. I am receiving the&amp;nbsp;&lt;STRONG&gt;Note: Invalid error to substring&lt;/STRONG&gt;, although it seems to be working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Have:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 201px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26138iD52D654494382AD6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Want:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 204px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26139iDCD8F482D340E0F7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call scan(_egtpt, -1, pos, length) ;
egtpt= upcase(substr(_egtpt,1, pos-2));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOG:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26140i84D216C273960754/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Any help with clearing the note would be appreciated. Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 18:59:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525812#M143087</guid>
      <dc:creator>mglogan</dc:creator>
      <dc:date>2019-01-09T18:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Call Scan Function Error with Substring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525814#M143088</link>
      <description>Can you post an example of the error with the log notes? That usually helps with determining what the issue is a lot quicker.</description>
      <pubDate>Wed, 09 Jan 2019 18:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525814#M143088</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-09T18:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Call Scan Function Error with Substring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525816#M143089</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w;
k='Pre-Dose 2';
/*call scan(k, -1, pos, length) ;*/
want=upcase(substr(k,1,length(k)-2));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Jan 2019 18:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525816#M143089</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-09T18:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Call Scan Function Error with Substring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525818#M143090</link>
      <description>Yes! updated post with image</description>
      <pubDate>Wed, 09 Jan 2019 19:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525818#M143090</guid>
      <dc:creator>mglogan</dc:creator>
      <dc:date>2019-01-09T19:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Call Scan Function Error with Substring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525821#M143091</link>
      <description>None of your examples generate an error with either your code or novinsorin's. I suspect you have some blank _egptpt entries and those records may be throwing an error.</description>
      <pubDate>Wed, 09 Jan 2019 19:07:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525821#M143091</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-09T19:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Call Scan Function Error with Substring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525822#M143092</link>
      <description>&lt;P&gt;If your variable value has just 1 digit value as the last value, you don't need call scan&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;want=upcase(substr(k,1,length(k)-2));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 19:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525822#M143092</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-09T19:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Call Scan Function Error with Substring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525824#M143093</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp;there were&amp;nbsp;a few missing values. Works great now!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 19:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525824#M143093</guid>
      <dc:creator>mglogan</dc:creator>
      <dc:date>2019-01-09T19:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Call Scan Function Error with Substring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525886#M143111</link>
      <description>&lt;P&gt;If you copy code and/or error messages&amp;nbsp;directly from your log you can paste the text into a codebox opened using the forum's {I} icon. Then edit anything you don't want to show such as XXXX for sensitive data. I think this may be easier than creating an image file, editing the image and the pasting the image in the forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then we can also highlight or otherwise indicate directly in the text where a problem may be.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 21:08:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Scan-Function-Error-with-Substring/m-p/525886#M143111</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-01-09T21:08:45Z</dc:date>
    </item>
  </channel>
</rss>

