<?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: substr with variable series/substr with arrays in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/substr-with-variable-series-substr-with-arrays/m-p/72732#M15660</link>
    <description>What does your if substr() mean? Do you want to apply AND or OR logic between the values in the series?&lt;BR /&gt;
&lt;BR /&gt;
I don't know of a way to do this in a single statement.&lt;BR /&gt;
My suggestion is to create a new array coupled with a variable series, then loop through both arrays assigning values to the new array. Or, you could couple the existing variable series to an array which would make it unnecessary to assign new values, just do the if thing.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
    <pubDate>Wed, 23 Sep 2009 08:51:53 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2009-09-23T08:51:53Z</dc:date>
    <item>
      <title>substr with variable series/substr with arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/substr-with-variable-series-substr-with-arrays/m-p/72731#M15659</link>
      <description>Can I use a variable series (eg blah1-blah24) in a substr statement?&lt;BR /&gt;
For example:&lt;BR /&gt;
data x; set y;&lt;BR /&gt;
substr (blah1-blah24, 1, 3) = '555' then ...&lt;BR /&gt;
&lt;BR /&gt;
Alternately, can I create new variable series using substr then use the new variable series in an array to look for the specified value throughout the variable series?&lt;BR /&gt;
&lt;BR /&gt;
Thank you in advance for any assistance.&lt;BR /&gt;
Sincerely, melsop</description>
      <pubDate>Tue, 22 Sep 2009 22:32:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/substr-with-variable-series-substr-with-arrays/m-p/72731#M15659</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-09-22T22:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: substr with variable series/substr with arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/substr-with-variable-series-substr-with-arrays/m-p/72732#M15660</link>
      <description>What does your if substr() mean? Do you want to apply AND or OR logic between the values in the series?&lt;BR /&gt;
&lt;BR /&gt;
I don't know of a way to do this in a single statement.&lt;BR /&gt;
My suggestion is to create a new array coupled with a variable series, then loop through both arrays assigning values to the new array. Or, you could couple the existing variable series to an array which would make it unnecessary to assign new values, just do the if thing.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Wed, 23 Sep 2009 08:51:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/substr-with-variable-series-substr-with-arrays/m-p/72732#M15660</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-09-23T08:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: substr with variable series/substr with arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/substr-with-variable-series-substr-with-arrays/m-p/72733#M15661</link>
      <description>use an ARRAY statement to define the list of character variables. One of the CATx functions could return the entire array as a single string. The FIND function can do the searching. &lt;BR /&gt;
The CAT can appear within the FIND like&lt;BR /&gt;
 found = find( cat( of arrayname(*)), '555' ) ;&lt;BR /&gt;
Using the array statement allows unrelated columns to be concatenated.&lt;BR /&gt;
If you only want a numbered range of variables, then you don't need the array statement and the code reduces to&lt;BR /&gt;
  found = find( cat( of blah1 - blah24), '555');&lt;BR /&gt;
&lt;BR /&gt;
it isn't SUBSTR but I think CAT and  FIND do what your message seemed to want.&lt;BR /&gt;
 &lt;BR /&gt;
good luck&lt;BR /&gt;
PeterC</description>
      <pubDate>Thu, 01 Oct 2009 09:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/substr-with-variable-series-substr-with-arrays/m-p/72733#M15661</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-10-01T09:06:41Z</dc:date>
    </item>
  </channel>
</rss>

