<?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 compare two numeric value with macro code using in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545582#M150947</link>
    <description>&lt;P&gt;not understand from reply.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 24 Mar 2019 10:20:20 GMT</pubDate>
    <dc:creator>uspanchal</dc:creator>
    <dc:date>2019-03-24T10:20:20Z</dc:date>
    <item>
      <title>how to compare two numeric value with macro code using</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545577#M150943</link>
      <description>&lt;P&gt;I need to write following same code with using macro code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;do n = 1 to 5;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data comp;&lt;BR /&gt;set test;&lt;BR /&gt;do k=1 to 3 ;&lt;BR /&gt;array d (3);&lt;BR /&gt;do i=1 to k ;&lt;BR /&gt;if n &amp;gt;= i then d(i) = 1;&lt;BR /&gt;end;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 08:42:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545577#M150943</guid>
      <dc:creator>uspanchal</dc:creator>
      <dc:date>2019-03-24T08:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare two numeric value with macro code using</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545579#M150945</link>
      <description>&lt;P&gt;There is absolutely nothing that calls for macro programming.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 09:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545579#M150945</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-03-24T09:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare two numeric value with macro code using</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545582#M150947</link>
      <description>&lt;P&gt;not understand from reply.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 10:20:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545582#M150947</guid>
      <dc:creator>uspanchal</dc:creator>
      <dc:date>2019-03-24T10:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare two numeric value with macro code using</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545583#M150948</link>
      <description>&lt;P&gt;What &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; is trying to say, is he don't understand why you to make this into macro code - there is no obious need.&lt;/P&gt;
&lt;P&gt;So can you please state your objective?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Side note: in macro language, the default behaviour is to treat everything as text, not numerical values.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 10:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545583#M150948</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2019-03-24T10:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare two numeric value with macro code using</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545584#M150949</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151762"&gt;@uspanchal&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you care to explain your problem. It might be possible to simulate a data step using I/O functions in a macro, but it would be downright stupid to do it, so what are you trying to achieve?&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 10:29:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545584#M150949</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2019-03-24T10:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare two numeric value with macro code using</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545586#M150950</link>
      <description>&lt;P&gt;I want to compare numeric variable of data set using macro code so I need input how to write macro code for compare numeric value.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 10:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545586#M150950</guid>
      <dc:creator>uspanchal</dc:creator>
      <dc:date>2019-03-24T10:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare two numeric value with macro code using</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545588#M150951</link>
      <description>&lt;P&gt;Forget your macro obsession. You want to deal with data, not dynamically generated program code, so no macro action is needed.&lt;/P&gt;
&lt;P&gt;Comparisons of variables within one dataset is done in a data step (or proc sql), and comparison across different datasets is done with proc compare.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For detailed suggestions/solutions, provide existing data in usable form (data step(s) with datalines), and what you expect out of it.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 11:25:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545588#M150951</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-03-24T11:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare two numeric value with macro code using</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545593#M150952</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151762"&gt;@uspanchal&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I want to compare numeric variable of data set using macro code so I need input how to write macro code for compare numeric value.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Macro language is a text processor, to help you make your code dynamic so it changes as circumstances change. Numeric calculations should be performed in a data step or PROC, not in macro language.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 12:42:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545593#M150952</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-24T12:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare two numeric value with macro code using</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545594#M150953</link>
      <description>&lt;P&gt;here with attached dataset file HTWT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Write a macro to compare two numeric values.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;Use proc print and Use %if %then %do statement&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 13:48:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545594#M150953</guid>
      <dc:creator>uspanchal</dc:creator>
      <dc:date>2019-03-24T13:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare two numeric value with macro code using</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545601#M150957</link>
      <description>&lt;P&gt;Macro language can easily compare two numeric values.&amp;nbsp; If you have two macro variables (in this example, &amp;amp;N and &amp;amp;K), and they both contain integers only, you can use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;n &amp;gt; &amp;amp;k %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, so far you do not have any macro variables.&amp;nbsp; It's not clear what you are trying to compare.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to use macro language, you need to learn macro language.&amp;nbsp; Read a book.&amp;nbsp; Take a course.&amp;nbsp; You cannot learn macro language by asking a question or two on a message board.&amp;nbsp; To give you some examples ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What if your macro variables do not contain integers?&amp;nbsp; Decimal points are not considered integers.&amp;nbsp; Macro language returns the opposite result for these two comparisons:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if 10 &amp;gt; 4 %then %do;&lt;/P&gt;
&lt;P&gt;%if 10. &amp;gt; 4. %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While there are ways to handle this, the real message is that you need to learn macro language.&amp;nbsp; Without that knowledge, any answers you get are dangerous to apply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Relating to your original post ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no equivalent to a DATA statement in macro language.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no equivalent to a SET statement in macro language.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no equivalent to an ARRAY statement in macro language.&amp;nbsp; (Skillful macro programmers can use macro programming statements to mimic the behavior of an array.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no equivalent to an OUTPUT statement in macro language.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%IF %THEN statements almost always have to appear within a macro definition.&amp;nbsp; (It's not clear that you know what that means, and that would also be basic information you would learn from a book or a course.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your first task in tackling your homework is to find out what the question means.&amp;nbsp; Your .csv file contains no macro variables.&amp;nbsp; So what are you supposed to compare?&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 14:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545601#M150957</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-03-24T14:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare two numeric value with macro code using</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545602#M150958</link>
      <description>thanks a lot very useful information</description>
      <pubDate>Sun, 24 Mar 2019 14:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-two-numeric-value-with-macro-code-using/m-p/545602#M150958</guid>
      <dc:creator>uspanchal</dc:creator>
      <dc:date>2019-03-24T14:43:58Z</dc:date>
    </item>
  </channel>
</rss>

