<?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: Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/458137#M284501</link>
    <description>&lt;P&gt;Well first off, you would be better off modelling your toto dataset in such a way that you don't have to do this, i.e. just two columns x and y.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you can do something like:&lt;/P&gt;
&lt;PRE&gt;Data toto;&lt;BR /&gt;input a z e r t y;&lt;BR /&gt;cards;&lt;BR /&gt;1 2 3 4 5 77&lt;BR /&gt;6 45 4 8 7 99&lt;BR /&gt;4 5 6 8 7 22&lt;BR /&gt;1 2 5 4 7 88&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;%macro er (x,y);&lt;BR /&gt; %put x=&amp;amp;x. y=&amp;amp;y.;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;data _null_; &lt;BR /&gt; array tmp {*} a z e r t y;&lt;BR /&gt; do i=1 to 6;&lt;BR /&gt;   do j= i+1 to 6;&lt;BR /&gt;     call execute(cats('%er (x=',vname(tmp{i}),',y=',vname(tmp{j}),');'));&lt;BR /&gt;   end;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/PRE&gt;</description>
    <pubDate>Fri, 27 Apr 2018 14:07:53 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-04-27T14:07:53Z</dc:date>
    <item>
      <title>Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/458106#M284500</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a question about the macros.&lt;BR /&gt;Indeed in this simple example, I want to create a multitude of graphics.&lt;BR /&gt;Problem is that I have to write each time&amp;nbsp; %er&amp;nbsp; &amp;nbsp;(&amp;nbsp; &amp;nbsp; &amp;nbsp;,&amp;nbsp; &amp;nbsp;).&lt;/P&gt;&lt;P&gt;How to write that once&amp;nbsp; % er?&amp;nbsp;&amp;nbsp;But that all graphics are produced.&lt;/P&gt;&lt;P&gt;With% let?&amp;nbsp;&amp;nbsp;%let p= a e r t y;&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data toto;&lt;BR /&gt;input a z e r t y;&lt;BR /&gt;cards;&lt;BR /&gt;1 2 3 4 5 77&lt;BR /&gt;6 45 4 8 7 99&lt;BR /&gt;4 5 6 8 7 22&lt;BR /&gt;1 2 5 4 7 88&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro er (x,y);&lt;BR /&gt;proc sgplot data=toto;&lt;BR /&gt;scatter x=&amp;amp;x. y=&amp;amp;y./ datalabel;&lt;BR /&gt;run;&lt;BR /&gt;%mend;&lt;BR /&gt;%er (a,z);&lt;BR /&gt;%er (a,e);&lt;BR /&gt;%er (a,r);&lt;BR /&gt;%er (a,t);&lt;BR /&gt;%er (a,y);&lt;BR /&gt;%er (z,a);&lt;BR /&gt;%er (z,e);&lt;BR /&gt;%er (z,r);&lt;BR /&gt;%er (z,t);&lt;BR /&gt;%er (z,y);&lt;BR /&gt;%er (e,a);&lt;BR /&gt;%er (e,z);&lt;BR /&gt;%er (e,r);&lt;BR /&gt;%er (e,t);&lt;BR /&gt;%er (e,y);&lt;/P&gt;&lt;P&gt;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;.........It is too long&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 12:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/458106#M284500</guid>
      <dc:creator>WilliamB</dc:creator>
      <dc:date>2018-04-27T12:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/458137#M284501</link>
      <description>&lt;P&gt;Well first off, you would be better off modelling your toto dataset in such a way that you don't have to do this, i.e. just two columns x and y.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you can do something like:&lt;/P&gt;
&lt;PRE&gt;Data toto;&lt;BR /&gt;input a z e r t y;&lt;BR /&gt;cards;&lt;BR /&gt;1 2 3 4 5 77&lt;BR /&gt;6 45 4 8 7 99&lt;BR /&gt;4 5 6 8 7 22&lt;BR /&gt;1 2 5 4 7 88&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;%macro er (x,y);&lt;BR /&gt; %put x=&amp;amp;x. y=&amp;amp;y.;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;data _null_; &lt;BR /&gt; array tmp {*} a z e r t y;&lt;BR /&gt; do i=1 to 6;&lt;BR /&gt;   do j= i+1 to 6;&lt;BR /&gt;     call execute(cats('%er (x=',vname(tmp{i}),',y=',vname(tmp{j}),');'));&lt;BR /&gt;   end;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Apr 2018 14:07:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/458137#M284501</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-27T14:07:53Z</dc:date>
    </item>
  </channel>
</rss>

