<?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: Need help with a Macro formula in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430610#M281617</link>
    <description>&lt;P&gt;What are you expecting to come out of that formula?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;svc.BILL_SVC_UNIT_1_CD&amp;nbsp;is a variable in a data set, but the macro processor won't have access.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I suspect you may need a different approach to whatever problem you're trying to solve.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2018 19:26:25 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-01-24T19:26:25Z</dc:date>
    <item>
      <title>Need help with a Macro formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430608#M281616</link>
      <description>&lt;P&gt;Hello all. I am trying to create this Macro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%LET CODE = svc.BILL_SVC_UNIT_1_CD &amp;gt;= 'L0220' and svc.BILL_SVC_UNIT_1_CD &amp;lt;='L4631' and svc.BILL_SVC_UNIT_1_CD = '97760';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried putting parenthesis around it in various ways but it still doesnt work. It will work if I took off the 97760 portion but I need that. The only other option is to include each and every&amp;nbsp; L code which as one can see is a considerable amount.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 19:24:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430608#M281616</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-01-24T19:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a Macro formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430610#M281617</link>
      <description>&lt;P&gt;What are you expecting to come out of that formula?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;svc.BILL_SVC_UNIT_1_CD&amp;nbsp;is a variable in a data set, but the macro processor won't have access.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I suspect you may need a different approach to whatever problem you're trying to solve.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 19:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430610#M281617</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-24T19:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a Macro formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430618#M281618</link>
      <description>&lt;P&gt;This code is 100% fine.&amp;nbsp; It does exactly what it is supposed to do.&amp;nbsp; It assigns a long value to a macro variable named CODE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why do you say it is not working?&amp;nbsp; Show the log.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 19:39:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430618#M281618</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-01-24T19:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a Macro formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430629#M281619</link>
      <description>&lt;P&gt;Thanks Astounding. I was under the same impression. As I stated, it works as long as I do not use the last part. Its when I include it I get no results. The log has no errors it just doesn't produce any lines. If I take off the last part (with the 97760) I get a few thousand lines.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 19:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430629#M281619</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-01-24T19:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a Macro formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430632#M281620</link>
      <description>&lt;P&gt;I use this macro coding everyday as part of my job, its the combination that is not working. If I were to exclude the =&amp;gt; &amp;lt;= portion and just run the 97760, again I get results. Perhaps I should use "OR" instead of "AND"?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 19:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430632#M281620</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-01-24T19:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a Macro formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430634#M281621</link>
      <description>&lt;P&gt;Well&amp;nbsp; that last condition is probably mutually exclusive from the first two so it doesn't include any data because nothing meets both conditions. There's nothing wrong with the syntax but the logic is flawed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you mean to have an OR instead of AND?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;svc.BILL_SVC_UNIT_1_CD &amp;gt;= 'L0220' and svc.BILL_SVC_UNIT_1_CD&amp;lt;='L4631' 

and svc.BILL_SVC_UNIT_1_CD = '97760'; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114971"&gt;@wheddingsjr&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks Astounding. I was under the same impression. As I stated, it works as long as I do not use the last part. Its when I include it I get no results. The log has no errors it just doesn't produce any lines. If I take off the last part (with the 97760) I get a few thousand lines.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 19:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430634#M281621</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-24T19:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a Macro formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430635#M281622</link>
      <description>I think I got it. It should be OR instead of AND..its now running. Thanks Astounding and Reeza</description>
      <pubDate>Wed, 24 Jan 2018 19:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430635#M281622</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-01-24T19:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a Macro formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430638#M281623</link>
      <description>&lt;P&gt;Make sure to include parenthesis to properly have the AND and OR evaluate correctly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm assuming this is likely what you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(svc.BILL_SVC_UNIT_1_CD &amp;gt;= 'L0220' and svc.BILL_SVC_UNIT_1_CD &amp;lt;='L4631') OR svc.BILL_SVC_UNIT_1_CD = '97760';&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 19:56:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430638#M281623</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-24T19:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a Macro formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430639#M281624</link>
      <description>&lt;P&gt;Reeza...looks like we came to the same conclussion at the same time. As I was thinking about the OR instead of AND I see you asked the same question...lol&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 19:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430639#M281624</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-01-24T19:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a Macro formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430647#M281625</link>
      <description>&lt;P&gt;You want to be &lt;STRONG&gt;very&lt;/STRONG&gt; careful when using &amp;lt; or &amp;gt; comparisons with string values. If you think "L5" &amp;lt; "L4631" you might be somewhat surprised at results. Also for consideration are comparisons where capitalization of characters gets involved. Lower case letters are "greater than" their uppercase equivalents.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 20:07:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430647#M281625</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-24T20:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a Macro formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430665#M281626</link>
      <description>&lt;P&gt;Reeza, I had already run it without the parenthesis but to be on the safe side and to compare I ran it WITH the parenthesis and got 5 more lines than when not using the parenthesis. Going to have to reconcile the two. Thanks for your help!!!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 20:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-Macro-formula/m-p/430665#M281626</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-01-24T20:25:08Z</dc:date>
    </item>
  </channel>
</rss>

