<?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: IF-Loop in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/IF-Loop/m-p/47278#M12679</link>
    <description>&amp;gt; Hi, I use the code below :&lt;BR /&gt;
&amp;gt; data revenue2;&lt;BR /&gt;
&amp;gt; set CAT_SORT;&lt;BR /&gt;
&amp;gt; 	if Good = "A" THEN&lt;BR /&gt;
&amp;gt; 		Margin = 10*Unit;&lt;BR /&gt;
&amp;gt; 	if Good = "B" AND &lt;BR /&gt;
&amp;gt; 		"01/01/2001"&amp;lt;=Date&amp;lt;="31/01/2001" THEN&lt;BR /&gt;
&amp;gt; 		Margin = 20*Unit;&lt;BR /&gt;
&amp;gt; 	IF Good = "B" AND &lt;BR /&gt;
&amp;gt; 		"01/02/2002"&amp;lt;=Date&amp;lt;="28/02/2002" THEN&lt;BR /&gt;
&amp;gt; 		Margin = 30*Unit;&lt;BR /&gt;
&amp;gt; RUN;&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Is there a change that you could  sugeest so that I&lt;BR /&gt;
&amp;gt; use the IF twice only, that is, use Good="B" only&lt;BR /&gt;
&amp;gt; once.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Kind Regards,&lt;BR /&gt;
&amp;gt; Mar&lt;BR /&gt;
&lt;BR /&gt;
MarkC&lt;BR /&gt;
you need to rephrase your message as it is not appearing correctly because of special symbols like  &amp;lt;=

avoid using &amp;lt; or &amp;lt;= by using LT or LE in syntax you post&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Peter.C</description>
    <pubDate>Fri, 16 Jul 2010 13:32:32 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2010-07-16T13:32:32Z</dc:date>
    <item>
      <title>IF-Loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/IF-Loop/m-p/47277#M12678</link>
      <description>Hi, I use the code below :&lt;BR /&gt;
data revenue2;&lt;BR /&gt;
set CAT_SORT;&lt;BR /&gt;
	if Good = "A" THEN&lt;BR /&gt;
		Margin = 10*Unit;&lt;BR /&gt;
	if Good = "B" AND &lt;BR /&gt;
		"01/01/2001"&amp;lt;=Date&amp;lt;="31/01/2001" THEN&lt;BR /&gt;
		Margin = 20*Unit;&lt;BR /&gt;
	IF Good = "B" AND &lt;BR /&gt;
		"01/02/2002"&amp;lt;=Date&amp;lt;="28/02/2002" THEN&lt;BR /&gt;
		Margin = 30*Unit;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Is there a change that you could  sugeest so that I use the IF twice only, that is, use Good="B" only once.&lt;BR /&gt;
&lt;BR /&gt;
Kind Regards,&lt;BR /&gt;
Mar</description>
      <pubDate>Mon, 12 Jul 2010 04:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/IF-Loop/m-p/47277#M12678</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-12T04:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: IF-Loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/IF-Loop/m-p/47278#M12679</link>
      <description>&amp;gt; Hi, I use the code below :&lt;BR /&gt;
&amp;gt; data revenue2;&lt;BR /&gt;
&amp;gt; set CAT_SORT;&lt;BR /&gt;
&amp;gt; 	if Good = "A" THEN&lt;BR /&gt;
&amp;gt; 		Margin = 10*Unit;&lt;BR /&gt;
&amp;gt; 	if Good = "B" AND &lt;BR /&gt;
&amp;gt; 		"01/01/2001"&amp;lt;=Date&amp;lt;="31/01/2001" THEN&lt;BR /&gt;
&amp;gt; 		Margin = 20*Unit;&lt;BR /&gt;
&amp;gt; 	IF Good = "B" AND &lt;BR /&gt;
&amp;gt; 		"01/02/2002"&amp;lt;=Date&amp;lt;="28/02/2002" THEN&lt;BR /&gt;
&amp;gt; 		Margin = 30*Unit;&lt;BR /&gt;
&amp;gt; RUN;&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Is there a change that you could  sugeest so that I&lt;BR /&gt;
&amp;gt; use the IF twice only, that is, use Good="B" only&lt;BR /&gt;
&amp;gt; once.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Kind Regards,&lt;BR /&gt;
&amp;gt; Mar&lt;BR /&gt;
&lt;BR /&gt;
MarkC&lt;BR /&gt;
you need to rephrase your message as it is not appearing correctly because of special symbols like  &amp;lt;=

avoid using &amp;lt; or &amp;lt;= by using LT or LE in syntax you post&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Peter.C</description>
      <pubDate>Fri, 16 Jul 2010 13:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/IF-Loop/m-p/47278#M12679</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-07-16T13:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: IF-Loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/IF-Loop/m-p/47279#M12680</link>
      <description>Another option is to bookmark this link for future reference on forum posting guidelines with special-character content.&lt;BR /&gt;
&lt;BR /&gt;
Also, for MarkC (and other posters) -- think before you post, particularly when selecting a forum, rather than simply choosing the first one in the list -- honestly, you're not the only individual doing this but it's a gentle suggestion.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Thread: [Off-topic] Forum Markup &lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=27609" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=27609&lt;/A&gt;</description>
      <pubDate>Fri, 16 Jul 2010 14:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/IF-Loop/m-p/47279#M12680</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-16T14:23:28Z</dc:date>
    </item>
  </channel>
</rss>

