<?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 do you manage hundreds of macro variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81703#M17639</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not saying this is necessarily the best solution, but here's something to think about.&amp;nbsp; You could add a parameter to a macro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro A (next_macro_to_run=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then at the end of the macro definition, you could add:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if %length(&amp;amp;next_macro_to_run) %then %&amp;amp;next_macro_to_run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend A;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would make all the local macro variables that are part of %A available to the next macro that you would like to run.&amp;nbsp; For example, if you specified:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%A (next_macro_to_run=B)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that case, you would generate %B at the end of running %A.&amp;nbsp; And all of the %A local variables would still exist.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Mar 2013 21:32:12 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2013-03-19T21:32:12Z</dc:date>
    <item>
      <title>how do you manage hundreds of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81699#M17635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my current SAS system, which consists of nearly 100 macros, in each macro, there are at least over 10 macro variables in each macro.&lt;/P&gt;&lt;P&gt;It is a mess and makes me headache, just managing these many macro variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you manage these macro variables in an organized fashion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;organized meaning:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;each macro variable is unique in its functionality&lt;/LI&gt;&lt;LI&gt;different macro variables don't step over each other&lt;/LI&gt;&lt;LI&gt;the ability of switch on batch of macro variables across the macros&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 16:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81699#M17635</guid>
      <dc:creator>ZRick</dc:creator>
      <dc:date>2013-03-19T16:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: how do you manage hundreds of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81700#M17636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi: When you have macro programs (macros) that use macro variables, generally, the macro variables used in the macro programs are LOCAL in scope (exist for the duration of the macro program), unless you do something to make them GLOBAL in scope (exist for the duration of your SAS session). SAS has statements to manage the scope of a macro variable %LOCAL and %GLOBAL. And if you use the CALL SYMPUTX method of creating macro variables, you can explicitly control whether the macro variable is written to a global or local symbol table. Under special circumstances, prompt values on the BI platform can get automatically created as GLOBAL macro variables, so you have to be aware of this fact as you are writing your stored processes and macro programs to use in stored processes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I worked in a big shop that had more than 100 macro programs, we were required to have a huge comment section at the top of each macro program that outlined the macro variables that were global and coming from somewhere else and the macro variables that were local and we had to document the use and possible values of each macro variable and outline the error processing/validation that was performed for any macro variables being supplied as parameters on the invocation. We were not allowed to use positional parameters. We had to use keyword parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some systems, all our macro variables started with &lt;EM&gt;&lt;STRONG&gt;_macvarname&lt;/STRONG&gt;&lt;/EM&gt; or for others it was &lt;EM&gt;&lt;STRONG&gt;macvarname_A&lt;/STRONG&gt;&lt;/EM&gt;, &lt;EM&gt;&lt;STRONG&gt;macvarname_X &lt;/STRONG&gt;&lt;/EM&gt;where the _A meant first in importance, usually global macro variable and the _X meant "working" or "temporary" or used within the macro program for manipulation. Parameters were allowed to be defined without the _A, for example, but then as a first step in our macro program, we'd have some thing like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%LET macvar_X = %upcase(parmvar);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or whatever other manipulation we needed to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sure that other folks have other ways of working with lots of macro programs and macro variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 18:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81700#M17636</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2013-03-19T18:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: how do you manage hundreds of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81701#M17637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have to say that including "the ability of switch on batch of macro variables across the macros" as part of Organized brings chills to my spine. My feeling about this phrase when I first read it was you wanted to change scope of variables within macros conditionally which I think would require oodles of programming and possible not ever quite work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe we need some expansion of what you really mean by the phrase "the ability of switch on batch of macro variables across the macros" with examples of what you expect to accomplish with this feature.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 20:25:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81701#M17637</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-03-19T20:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: how do you manage hundreds of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81702#M17638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to describe what the macro variables are doing?&lt;/P&gt;&lt;P&gt;Ideally you would have only local macro variables. So each macro might have a few input parameters (which are by definition local) and define some local macro variables that it uses while it is running.&lt;/P&gt;&lt;P&gt;If you need to pass a value into a macro then you would do it though the parameters.&lt;/P&gt;&lt;P&gt;If you need to pass a value back from a macro to its calling environment then pass the name of the macro variable.&amp;nbsp; Or better still pass the values in a dataset instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 20:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81702#M17638</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-03-19T20:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: how do you manage hundreds of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81703#M17639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not saying this is necessarily the best solution, but here's something to think about.&amp;nbsp; You could add a parameter to a macro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro A (next_macro_to_run=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then at the end of the macro definition, you could add:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if %length(&amp;amp;next_macro_to_run) %then %&amp;amp;next_macro_to_run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend A;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would make all the local macro variables that are part of %A available to the next macro that you would like to run.&amp;nbsp; For example, if you specified:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%A (next_macro_to_run=B)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that case, you would generate %B at the end of running %A.&amp;nbsp; And all of the %A local variables would still exist.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 21:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81703#M17639</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-03-19T21:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: how do you manage hundreds of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81704#M17640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I avoid having that many like hell. :smileydevil:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd be curious to know why you do have so many, and from there I'm sure people will have suggestions on how to reduce and/or manage them more efficiently. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 21:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81704#M17640</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-03-19T21:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: how do you manage hundreds of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81705#M17641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because we are developing production system using SAS.&lt;/P&gt;&lt;P&gt;We need to have the production system that is:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;robust that is less error prone &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;scalable that can handle small / large volume of data &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;versatile that meet all kinds of different needs with different sets of parameters &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;portable that have the design of object oriented rather than procedure oriented&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It becomes challenge in every system design/development that have above goals.&lt;/P&gt;&lt;P&gt;That is why we have hundred macros with many macro variables for macros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In adhoc environment, any data step can do meet all kinds of needs, but once to have a data step truly up to production strength, it is very difficult.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data t;&lt;/P&gt;&lt;P&gt;set t;&lt;/P&gt;&lt;P&gt;a+b;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it can easily add hundreds of lines of code with macro variable to code the above data step with all different layers to make it really production ready.&lt;/P&gt;&lt;P&gt;I just want to like to hear if some of the experts who handled this this scenario before.&lt;/P&gt;&lt;P&gt;Try to have an overall picture, please. Any suggestions is greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 02:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81705#M17641</guid>
      <dc:creator>ZRick</dc:creator>
      <dc:date>2013-03-20T02:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: how do you manage hundreds of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81706#M17642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still not clear why you need "hundreds" of macro variables.&amp;nbsp; Many complicated environments have been built using SAS that do not require very many macro variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 02:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81706#M17642</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-03-20T02:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: how do you manage hundreds of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81707#M17643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you acknowledge that "...it's a mess and gives you a headache", and rearchitect your approach?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not saying the below is the best approach - I threw it together in a hurry - but perhaps it gives you some ideas...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New'; color: #0433ff;"&gt;options&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;mprint&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New'; color: #008f00;"&gt;* first approach - "wide" dataset ;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/SPAN&gt; test(metadata=sashelp.cars,make=,model=);&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set &amp;amp;metadata;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where strip(make)=&lt;SPAN style="color: #942193;"&gt;"&amp;amp;make"&lt;/SPAN&gt; and strip(model)=&lt;SPAN style="color: #942193;"&gt;"&amp;amp;model"&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length dummy $&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; name $&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;32&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call missing(dummy);&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do while (&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call vnext(name);&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (name in (&lt;SPAN style="color: #942193;"&gt;"model"&lt;/SPAN&gt;,&lt;SPAN style="color: #942193;"&gt;"type"&lt;/SPAN&gt;)) then continue;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (name=&lt;SPAN style="color: #942193;"&gt;"dummy"&lt;/SPAN&gt;) then leave;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symputx(&lt;SPAN style="color: #942193;"&gt;"__"&lt;/SPAN&gt;||name,vvaluex(name),&lt;SPAN style="color: #942193;"&gt;"L"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; %&lt;STRONG&gt;&lt;EM&gt;printmvars&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;EM&gt;printmvars&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; proc sql;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select name,value from dictionary.macros where name like &lt;SPAN style="color: #942193;"&gt;"^__%"&lt;/SPAN&gt; escape &lt;SPAN style="color: #942193;"&gt;"^"&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;%&lt;STRONG&gt;&lt;EM&gt;test&lt;/EM&gt;&lt;/STRONG&gt;(make=Acura, model=MDX);&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New'; color: #008f00;"&gt;&lt;SPAN style="color: #000000;"&gt;%&lt;STRONG&gt;&lt;EM&gt;test&lt;/EM&gt;&lt;/STRONG&gt;(make=Cadillac, model=Escalade); &lt;/SPAN&gt;* the choice of swinging golfers everywhere ;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New'; color: #008f00;"&gt;* second approach - "tall" dataset ;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; metadata;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;length&lt;/SPAN&gt; macroname name $&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;32&lt;/STRONG&gt;&lt;/SPAN&gt; value $&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;200&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;input&lt;/SPAN&gt; macroname name value;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New'; color: #0433ff;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;datalines&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;TEST1 FOO&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;TEST1 BAR&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;TEST1 BLAH&amp;nbsp; 3&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;TEST2 WHATEVER 4&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;TEST2 IMDONE&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/SPAN&gt; createmvars(metadata=metadata,mname=);&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;%let&lt;/SPAN&gt; mname=&lt;SPAN style="color: #0433ff;"&gt;%upcase&lt;/SPAN&gt;(&amp;amp;mname);&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set &amp;amp;metadata;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where upcase(macroname)=&lt;SPAN style="color: #942193;"&gt;"&amp;amp;mname"&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symputx(name,value,&lt;SPAN style="color: #942193;"&gt;"L"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; %&amp;amp;mname&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;EM&gt;test1&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; proc sql;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from dictionary.macros where scope in (&lt;SPAN style="color: #942193;"&gt;"CREATEMVARS"&lt;/SPAN&gt;,&lt;SPAN style="color: #942193;"&gt;"&amp;amp;sysmacroname"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;%put&lt;/SPAN&gt; &amp;amp;foo &amp;amp;bar &amp;amp;blah;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;EM&gt;test2&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; proc sql;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from dictionary.macros where scope in (&lt;SPAN style="color: #942193;"&gt;"CREATEMVARS"&lt;/SPAN&gt;,&lt;SPAN style="color: #942193;"&gt;"&amp;amp;sysmacroname"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;%put&lt;/SPAN&gt; &amp;amp;whatever &amp;amp;imdone;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;%&lt;STRONG&gt;&lt;EM&gt;createmvars&lt;/EM&gt;&lt;/STRONG&gt;(mname=test1);&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Courier New';"&gt;%&lt;STRONG&gt;&lt;EM&gt;createmvars&lt;/EM&gt;&lt;/STRONG&gt;(mname=test2);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 11:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81707#M17643</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2013-03-20T11:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: how do you manage hundreds of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81708#M17644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;
&lt;P&gt;ZRick wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Because we are developing production system using SAS.&lt;/P&gt;
&lt;P&gt;We need to have the production system that is:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;robust that is less error prone &lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;scalable that can handle small / large volume of data &lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;versatile that meet all kinds of different needs with different sets of parameters &lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;portable that have the design of object oriented rather than procedure oriented&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Once upon a time I would have suggested SAS FSP/AF as that product combination is object oriented.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 14:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-do-you-manage-hundreds-of-macro-variables/m-p/81708#M17644</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-03-20T14:29:20Z</dc:date>
    </item>
  </channel>
</rss>

