<?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: go over all the observations and do macro calculations in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/804984#M33444</link>
    <description>&lt;P&gt;I'm not sure that using a SAS Macro is the technical solution to your problem. What would really help: Provide sample data in the form of a SAS data step creating this sample data, show us the desired result based on the sample data, explain the logic how to get from the sample data to the desired result.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Mar 2022 08:46:22 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2022-03-30T08:46:22Z</dc:date>
    <item>
      <title>go over all the observations and do macro calculations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/804980#M33441</link>
      <description>&lt;P&gt;hi all&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with N observations and 2 variables X &amp;amp; Y.&lt;/P&gt;&lt;P&gt;I want to execute a macro function for each observation, that means i need to execute N times.&lt;/P&gt;&lt;P&gt;Each time the inputs of the macro are the values of X and Y, like %fn(input1=X,input2=Y)&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to program as quickly as possible?&lt;/P&gt;&lt;P&gt;Thanks very much&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 08:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/804980#M33441</guid>
      <dc:creator>Xiyuan</dc:creator>
      <dc:date>2022-03-30T08:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: go over all the observations and do macro calculations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/804982#M33442</link>
      <description>The format of X and Y are both numeric</description>
      <pubDate>Wed, 30 Mar 2022 08:28:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/804982#M33442</guid>
      <dc:creator>Xiyuan</dc:creator>
      <dc:date>2022-03-30T08:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: go over all the observations and do macro calculations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/804983#M33443</link>
      <description>&lt;P&gt;Use Call Execute logic and the macro in combination.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a more detailed answer, provide sample data please.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 08:44:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/804983#M33443</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-03-30T08:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: go over all the observations and do macro calculations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/804984#M33444</link>
      <description>&lt;P&gt;I'm not sure that using a SAS Macro is the technical solution to your problem. What would really help: Provide sample data in the form of a SAS data step creating this sample data, show us the desired result based on the sample data, explain the logic how to get from the sample data to the desired result.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 08:46:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/804984#M33444</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-03-30T08:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: go over all the observations and do macro calculations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/805001#M33445</link>
      <description>&lt;P&gt;Okay, you told us X and Y are numeric (even though that probably doesn't help at this point in time). Now tell us what %FN does.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 10:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/805001#M33445</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-30T10:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: go over all the observations and do macro calculations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/805285#M33468</link>
      <description>&lt;P&gt;have you considered proc fcmp? I think it can help you here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 14:17:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/805285#M33468</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-03-31T14:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: go over all the observations and do macro calculations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/805364#M33480</link>
      <description>&lt;P&gt;Assuming you called the macro a "function" out of habit and not because you think will behave the same as a SAS function like LOG() or MEAN() you could just generate one macro call per observation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So assuming that your dataset is named HAVE you could run something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename code temp;
data _null_;
  set have;
  file code;
  put '%fn(input1=' X ',input2=' Y ')' ;
run;
%include code / source2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The data step will write one line of code per observation.&amp;nbsp; The %INCLUDE statement will then run the generated lines of code.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 17:06:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/go-over-all-the-observations-and-do-macro-calculations/m-p/805364#M33480</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-31T17:06:09Z</dc:date>
    </item>
  </channel>
</rss>

