<?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: question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/question/m-p/749578#M235580</link>
    <description>&lt;P&gt;I'm sorry to say that "*--HS002" does not begin with "HS002"... but is this the result you want?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-06-23_00h00_08.png" style="width: 362px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60615i833BE57FFAFAA4DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-06-23_00h00_08.png" alt="2021-06-23_00h00_08.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jun 2021 15:02:53 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2021-06-22T15:02:53Z</dc:date>
    <item>
      <title>question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/question/m-p/749554#M235566</link>
      <description>&lt;P&gt;I have the followings,&lt;/P&gt;&lt;PRE class="_3rGPyS-T4z661D_PbTU36A allowTextSelection"&gt;*--FA807518F1456-FA807518F1456-1002-07-HS002193888 
*--HS002108475----HS002108475 
*---HS002105485---SFHS002105485 
*---HS002105485---SFHS002105485 
*---HS002105485---SFHS002105485 
*---HS002105485---SFHS002105485 
*------SFHS002106080 
*------AAZKA021821TSPLOS 
*------AAZKA021821TSPBRK 
*------AAZKA030421TSPLOS 
*------AAZKA030421TSPBRK 
*------AAZKA031821TSPBRK 
*--HQ0642149245----HQ0642149245 
*------AAZKA040121TSPLOS 
*------AAZKA041221TSPBRK 
*---HS47371659Z010---HS47371659Z010 
*--HQ0642149245----HQ0642149245 
*--AGENTPAGE----HS002121076MW0 
*--ZKA----AA 
*--ZKA----AA 
*--AGENTGUZMAN----HS002121076MW0 
*--AGENTLEE----HS002121076MW0 
*--AGENTMELLGREN2----HS002121076MW0 
*--AGENTPRICE----HS002121076MW0 
*--PWFFSA21337860321--0007--HAFC0583142 
*--AGENTELDRIDGE----HS002121076MW0 
*--AGENTMELLGREN----HS002121076MW0 
*------AAZKA042921TSPBRK 
*--N0003421----AA &lt;BR /&gt;&lt;BR /&gt;I am trying to get those rows that start with HS002 or ZKA and place them in a variable called GOTIT. Some kind of substring. Thank you!&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Jun 2021 14:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/question/m-p/749554#M235566</guid>
      <dc:creator>mauri0623</dc:creator>
      <dc:date>2021-06-22T14:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/question/m-p/749569#M235575</link>
      <description>&lt;P&gt;What does the "*--" mean?&lt;BR /&gt;Can you describe the image of the dataset you want?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 14:46:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/question/m-p/749569#M235575</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-06-22T14:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/question/m-p/749572#M235577</link>
      <description>That is a part of the string. I want the HS002 rows.</description>
      <pubDate>Tue, 22 Jun 2021 14:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/question/m-p/749572#M235577</guid>
      <dc:creator>mauri0623</dc:creator>
      <dc:date>2021-06-22T14:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/question/m-p/749578#M235580</link>
      <description>&lt;P&gt;I'm sorry to say that "*--HS002" does not begin with "HS002"... but is this the result you want?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-06-23_00h00_08.png" style="width: 362px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60615i833BE57FFAFAA4DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-06-23_00h00_08.png" alt="2021-06-23_00h00_08.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 15:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/question/m-p/749578#M235580</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-06-22T15:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/question/m-p/749584#M235583</link>
      <description>Hi:&lt;BR /&gt;  What about the "ZKA" requirement. I see rows that have --ZKA-- and I see rows that have AAZKA. Also, do you want a separate dataset with ONLY the HS002 and ZKA rows or do you want to keep the original data and create a new variable called GOTIT?&lt;BR /&gt;Cynthia</description>
      <pubDate>Tue, 22 Jun 2021 15:12:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/question/m-p/749584#M235583</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-06-22T15:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/question/m-p/749585#M235584</link>
      <description>Only HS002 and ZKA.</description>
      <pubDate>Tue, 22 Jun 2021 15:13:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/question/m-p/749585#M235584</guid>
      <dc:creator>mauri0623</dc:creator>
      <dc:date>2021-06-22T15:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/question/m-p/749604#M235592</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; But those strings appear multiple places, as shown below. The WHERE_HS variable shows the place in the string where HS002 is found and the WHERE_ZK shows the place in the string where ZKA is found. Do you want ALL of those rows? Or are there more criteria?&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;These are all the rows that have HS002 or ZKA:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1624376272956.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60625i92469F7F11DEEE06/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1624376272956.png" alt="Cynthia_sas_0-1624376272956.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You initially listed 29 rows and 24 rows met the simple condition of having either HS002 or ZKA in the string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 15:39:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/question/m-p/749604#M235592</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-06-22T15:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/question/m-p/749607#M235595</link>
      <description>*--HS002108475----HS002108475&lt;BR /&gt;*---HS002105485---SFHS002105485&lt;BR /&gt;*---HS002105485---SFHS002105485&lt;BR /&gt;*---HS002105485---SFHS002105485&lt;BR /&gt;*---HS002105485---SFHS002105485&lt;BR /&gt;*--ZKA----AA&lt;BR /&gt;*--ZKA----AA&lt;BR /&gt;only these one.</description>
      <pubDate>Tue, 22 Jun 2021 15:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/question/m-p/749607#M235595</guid>
      <dc:creator>mauri0623</dc:creator>
      <dc:date>2021-06-22T15:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/question/m-p/749648#M235626</link>
      <description>HI: &lt;BR /&gt;  Thanks for the clarification. What code have you tried? Based on a quick test, it seems like the INDEX function would work for you.&lt;BR /&gt;Cynthia</description>
      <pubDate>Tue, 22 Jun 2021 17:37:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/question/m-p/749648#M235626</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-06-22T17:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/question/m-p/749667#M235637</link>
      <description>I tried index but the values are coming up as numbers.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Jun 2021 18:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/question/m-p/749667#M235637</guid>
      <dc:creator>mauri0623</dc:creator>
      <dc:date>2021-06-22T18:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/question/m-p/749739#M235675</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181538"&gt;@mauri0623&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I tried index but the values are coming up as numbers.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Of course they are. Index returns a position number of where the value is found and 0 when not found.&lt;/P&gt;
&lt;P&gt;So typically if the criteria is "somevalue somewhere in the variable" then code often looks like:&lt;/P&gt;
&lt;PRE&gt;If index(variable,'somevalue') &amp;gt; 0 then &amp;lt;do something&amp;gt;;&lt;/PRE&gt;
&lt;P&gt;where the "do something" could be assign a value to a variable, delete the record, start a DO/End block of code to do something more complex.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 21:59:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/question/m-p/749739#M235675</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-22T21:59:59Z</dc:date>
    </item>
  </channel>
</rss>

