<?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 execute same macro on different colors in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/execute-same-macro-on-different-colors/m-p/339808#M272623</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if I can use %do_over or any other loop function to write the following code?&lt;/P&gt;&lt;P&gt;by the way, the values in () are options following "pattern=" in proc sgplot&lt;/P&gt;&lt;PRE&gt;%drawplot(dot);
%drawplot(solid);
%drawplot(dash);
%drawplot(longdash);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2017 22:05:41 GMT</pubDate>
    <dc:creator>joseph626</dc:creator>
    <dc:date>2017-03-09T22:05:41Z</dc:date>
    <item>
      <title>execute same macro on different colors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/execute-same-macro-on-different-colors/m-p/339808#M272623</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if I can use %do_over or any other loop function to write the following code?&lt;/P&gt;&lt;P&gt;by the way, the values in () are options following "pattern=" in proc sgplot&lt;/P&gt;&lt;PRE&gt;%drawplot(dot);
%drawplot(solid);
%drawplot(dash);
%drawplot(longdash);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 22:05:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/execute-same-macro-on-different-colors/m-p/339808#M272623</guid>
      <dc:creator>joseph626</dc:creator>
      <dc:date>2017-03-09T22:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: execute same macro on different colors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/execute-same-macro-on-different-colors/m-p/339812#M272624</link>
      <description>&lt;P&gt;Yes...look at CALL EXECUTE or DOSUBL&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 22:12:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/execute-same-macro-on-different-colors/m-p/339812#M272624</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-09T22:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: execute same macro on different colors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/execute-same-macro-on-different-colors/m-p/339828#M272625</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Below is a 'do_over' implementation
and a dosubl implementation.

I am not a fan of 'call execute'.
Hopefully SAS will someday alloe
'%do' and '%if' in open code;

*    _
  __| | ___     _____   _____ _ __
 / _` |/ _ \   / _ \ \ / / _ \ '__|
| (_| | (_) | | (_) \ V /  __/ |
 \__,_|\___/___\___/ \_/ \___|_|
          |_____|
;


%macro drawplot(syms);
  %put ****  &amp;amp;=syms  *******;
%mend drawplot;

%array(sym,values=dot solid dash longdash);
%DO_OVER(sym,macro=drawplot);

****  SYMS=dot  *******
****  SYMS=solid  *******
****  SYMS=dash  *******
****  SYMS=longdash  *******

*    _                 _     _
  __| | ___  ___ _   _| |__ | |
 / _` |/ _ \/ __| | | | '_ \| |
| (_| | (_) \__ \ |_| | |_) | |
 \__,_|\___/|___/\__,_|_.__/|_|

;

data _null_;
  do sym="dot", "solid",  "dash", "longdash";
     call symputx('syms',sym);
     rc=dosubl('
        %drawplot(&amp;amp;syms);
     ');
  end;
run;quit;


****  SYMS=dot  *******
****  SYMS=solid  *******
****  SYMS=dash  *******
****  SYMS=longdash  *******



SOAPBOX ON
I favor this because, the more of us that use it,
the more likely SAS will not deprecate it.
It has enomous potential(like the somewhat deprecated libname engineS), and unlike the
trivial implementation of 'call exceute', it
requires very skilled SAS developers to bring
it to it's full potential.

It is also a language differentiator(ie it
will put WPS and others on their toes.)

SOAPBOX OFF


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Mar 2017 23:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/execute-same-macro-on-different-colors/m-p/339828#M272625</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-03-09T23:34:50Z</dc:date>
    </item>
  </channel>
</rss>

