<?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: How to keep 2 variables values using the SUBSTR function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-keep-2-variables-values-using-the-SUBSTR-function/m-p/263275#M51515</link>
    <description>&lt;P&gt;The simplest solution would be to get rid of this statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;&lt;U&gt;IF SUBSTR(DocClause,2,4)="MR14" ;&lt;/U&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The condition relating to "MR" would already include all of the "MR14" cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's important to note that the IF conditions operate as if the word AND were joining them.&amp;nbsp; For an observation to make it all the way through into the final data set, it must satisfy all of the IF statements.&amp;nbsp; If it makes sense, you can join multiple conditions using the word OR.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2016 17:16:13 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-04-12T17:16:13Z</dc:date>
    <item>
      <title>How to keep 2 variables values using the SUBSTR function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-keep-2-variables-values-using-the-SUBSTR-function/m-p/263267#M51511</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm creating a second dataset using the SUBSTR function to keep all the data I need based on variables values.&lt;/P&gt;
&lt;P&gt;For the variable &lt;EM&gt;DocClause&lt;/EM&gt;, I have two different values I would like to keep in the dataset I am creating, "MR" and "MR14".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code below only keeps the value "MR14" on the created dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to keep "MR14" and "MR" in my new dataset using the SUBSTR function?&lt;/P&gt;
&lt;PRE&gt;DATA MEMOIRE.CDS_BBB_US_MR;
	SET MEMOIRE.CDS_2001_2015;
	IF SUBSTR(ImpliedRating,2,3)="BBB";
	IF SUBSTR(Country,2,13)="United States";
	&lt;STRONG&gt;&lt;U&gt;IF SUBSTR(DocClause,2,2)="MR";&lt;/U&gt;
	&lt;U&gt;IF SUBSTR(DocClause,2,4)="MR14";&lt;/U&gt;&lt;/STRONG&gt;
	IF SUBSTR(Sector,2,10)="Government" THEN delete;
RUN;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 17:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-keep-2-variables-values-using-the-SUBSTR-function/m-p/263267#M51511</guid>
      <dc:creator>AntoineA</dc:creator>
      <dc:date>2016-04-12T17:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to keep 2 variables values using the SUBSTR function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-keep-2-variables-values-using-the-SUBSTR-function/m-p/263275#M51515</link>
      <description>&lt;P&gt;The simplest solution would be to get rid of this statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;&lt;U&gt;IF SUBSTR(DocClause,2,4)="MR14" ;&lt;/U&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The condition relating to "MR" would already include all of the "MR14" cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's important to note that the IF conditions operate as if the word AND were joining them.&amp;nbsp; For an observation to make it all the way through into the final data set, it must satisfy all of the IF statements.&amp;nbsp; If it makes sense, you can join multiple conditions using the word OR.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 17:16:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-keep-2-variables-values-using-the-SUBSTR-function/m-p/263275#M51515</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-12T17:16:13Z</dc:date>
    </item>
  </channel>
</rss>

