<?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 Index in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71713#M7136</link>
    <description>%let a=ex_table_case_23jan2008;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
i have to extract "23jan2008" string.&lt;BR /&gt;
here _ is a delimeter .i have to extract the string which come after last occurance of  _ (underscore) in macro variable a.&lt;BR /&gt;
&lt;BR /&gt;
please help...</description>
    <pubDate>Thu, 29 Jan 2009 12:35:47 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-01-29T12:35:47Z</dc:date>
    <item>
      <title>Index</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71713#M7136</link>
      <description>%let a=ex_table_case_23jan2008;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
i have to extract "23jan2008" string.&lt;BR /&gt;
here _ is a delimeter .i have to extract the string which come after last occurance of  _ (underscore) in macro variable a.&lt;BR /&gt;
&lt;BR /&gt;
please help...</description>
      <pubDate>Thu, 29 Jan 2009 12:35:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71713#M7136</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-29T12:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Index</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71714#M7137</link>
      <description>%let last_bit = %scan( &amp;amp;A, -1, _ );&lt;BR /&gt;
  &lt;BR /&gt;
PeterC</description>
      <pubDate>Thu, 29 Jan 2009 13:44:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71714#M7137</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-29T13:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Index</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71715#M7138</link>
      <description>sorry ..&lt;BR /&gt;
&lt;BR /&gt;
i have to extract "ex_table_case" from the macro variable a.</description>
      <pubDate>Thu, 29 Jan 2009 14:19:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71715#M7138</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-29T14:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Index</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71716#M7139</link>
      <description>sorry that was not obvious from your request.&lt;BR /&gt;
Try this[pre]   %let a=ex_table_case_23jan2008;&lt;BR /&gt;
   %let last_bit = %scan( &amp;amp;A, -1, _ );&lt;BR /&gt;
  &lt;BR /&gt;
   %let rev1_ = %sysfunc(reverse( &amp;amp;a )) ;&lt;BR /&gt;
   %let last_ = %sysfunc(index( &amp;amp;rev1_, _ )) ;&lt;BR /&gt;
   %let rest_ = %substr(&amp;amp;rev1_,%eval(1+&amp;amp;last_)) ;&lt;BR /&gt;
   %let wanted = %sysfunc( reverse(&amp;amp;rest_));&lt;BR /&gt;
 &lt;BR /&gt;
   %put wanted = &amp;amp;wanted ;[/pre]That gives me:[pre]71   %let a=ex_table_case_23jan2008;&lt;BR /&gt;
72&lt;BR /&gt;
73   %let last_bit = %scan( &amp;amp;A, -1, _ );&lt;BR /&gt;
74   %let rev1_ = %sysfunc(reverse( &amp;amp;a )) ;&lt;BR /&gt;
75   %let last_ = %sysfunc(index( &amp;amp;rev1_, _ )) ;&lt;BR /&gt;
76   %let rest_ = %substr(&amp;amp;rev1_,%eval(1+&amp;amp;last_)) ;&lt;BR /&gt;
77   %let wanted = %sysfunc( reverse(&amp;amp;rest_));&lt;BR /&gt;
78&lt;BR /&gt;
79   %put wanted = &amp;amp;wanted ;&lt;BR /&gt;
wanted = ex_table_case[/pre]&lt;BR /&gt;
&lt;BR /&gt;
PeterC</description>
      <pubDate>Thu, 29 Jan 2009 14:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71716#M7139</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-29T14:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Index</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71717#M7140</link>
      <description>Thanks Peter_c&lt;BR /&gt;
&lt;BR /&gt;
i want to ask one more thing..using index(), it is not possible to find last occurance of  _ (underscore ) in the string &amp;amp;a.</description>
      <pubDate>Fri, 30 Jan 2009 04:12:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71717#M7140</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-30T04:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Index</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71718#M7141</link>
      <description>I would have, if I could have..... , unless, perhaps you can achieve it with regular expression handling...... over to you ...&lt;BR /&gt;
  &lt;BR /&gt;
  &lt;BR /&gt;
PeterC</description>
      <pubDate>Fri, 30 Jan 2009 09:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71718#M7141</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-30T09:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Index</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71719#M7142</link>
      <description>Hi Arvind,&lt;BR /&gt;
&lt;BR /&gt;
INDEX can only search forward -- PeterC's technique of using INDEX and REVERSE definitely works in this way. There is a new SAS 9 function, FIND, which is like INDEX but with more bells and whistles. In particular, it can search backwards.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/59540/HTML/default/a002267763.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/59540/HTML/default/a002267763.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  call symputx("lastu",find("&amp;amp;a","_",-9999));&lt;BR /&gt;
run;&lt;BR /&gt;
 /* The -9999 is just an arbitrary number longer than &lt;BR /&gt;
 the text string. This forces a backward search. */&lt;BR /&gt;
&lt;BR /&gt;
%let soln2=%substr(&amp;amp;a,1,%eval(&amp;amp;lastu-1));&lt;BR /&gt;
&lt;BR /&gt;
Changed original reply - I wasn't looking carefully enough at the revised request for ex_table_case ... this should now work!&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: RichardH

Message was edited by: RichardH</description>
      <pubDate>Mon, 02 Feb 2009 14:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71719#M7142</guid>
      <dc:creator>RichardH_sas</dc:creator>
      <dc:date>2009-02-02T14:55:11Z</dc:date>
    </item>
    <item>
      <title>Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71720#M7143</link>
      <description>Hi I am writing a program and I was wondering if I should use Enterprise Guide or SAS programming.  I need to use substrings, can I use substrings using enterprise guide. Lets say for example I have a Date of Visit and I need only certain years and certain months within those years.  Can I do this using Enterprise Guide.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help.&lt;BR /&gt;
&lt;BR /&gt;
Rabiya</description>
      <pubDate>Mon, 02 Feb 2009 22:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71720#M7143</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-02-02T22:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71721#M7144</link>
      <description>for a new qustion, please start a new thread</description>
      <pubDate>Tue, 03 Feb 2009 09:39:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Index/m-p/71721#M7144</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-02-03T09:39:01Z</dc:date>
    </item>
  </channel>
</rss>

