<?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: Using and Creating Macro Variables in the Same Data Step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258751#M49907</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31807"&gt;@gaussian&lt;/a&gt; wrote:&lt;BR /&gt;Arrays will work but I prefer macro programming.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is NOT a matter of preference. Macro language is simply NOT the right tool for this.&lt;/P&gt;
&lt;P&gt;Use a hammer for nails, a screwdriver for screws, and a spanner for nuts.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Mar 2016 08:09:21 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-03-24T08:09:21Z</dc:date>
    <item>
      <title>Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258653#M49867</link>
      <description>&lt;P&gt;I am trying to create new variables based on the value of a macro variable created in the same data step. &amp;nbsp;But I can't get this working. Can anyone help with this please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output I want to see is creation of new variables Month1-Month10 while reading in the first observation (&amp;amp;z=1). &amp;nbsp;When reading the second observation, variables Month2-Month10 are populated (&amp;amp;z=2).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test;
	v=1; w=0.5; output;
	v=2; w=0.7; output;
run;
%symdel z;
data test2;
	set test;
	call symput('z',compress(put(v,8.)));
	%macro test;
	%do t=&amp;amp;z %to 10;
		month&amp;amp;t = 2*w;
	%end;
	%mend;
	%test;
run;
%put &amp;amp;z;&lt;BR /&gt;&lt;BR /&gt;WARNING: Apparent symbolic reference Z not resolved.&lt;BR /&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &lt;BR /&gt; &amp;amp;z &lt;BR /&gt;ERROR: The %FROM value of the %DO T loop is invalid.&lt;BR /&gt;ERROR: The macro TEST will stop executing.&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Mar 2016 22:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258653#M49867</guid>
      <dc:creator>gaussian</dc:creator>
      <dc:date>2016-03-23T22:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258655#M49868</link>
      <description>&lt;P&gt;1. It's very confusing to read code where a macro is defined within a data step.&lt;/P&gt;
&lt;P&gt;2. Why use a macro at all in this case? Pretty sure you can&amp;nbsp;accomplish this task with standard datastep code.&lt;/P&gt;
&lt;P&gt;3. Why do you want to read the value of the macro variable within the same data step? I can't&amp;nbsp;imagine any case where that is necessary.&amp;nbsp;Just use the value of variable v directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 22:22:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258655#M49868</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-23T22:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258669#M49874</link>
      <description>&lt;P&gt;I agree ... this is in no way supposed to be a macro application. &amp;nbsp;There's nothing wrong with a DATA step saying:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do t=z to 10;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And there's nothing wrong with an array containing MONTH1-MONTH10 within a DATA step and coding:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;m{t} = w * 2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no such thing as a DATA step that changes its statements for each observation. &amp;nbsp;The DATA step code must end up being a constant set of characters, whether macro language is involved or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 23:19:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258669#M49874</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-03-23T23:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258671#M49876</link>
      <description>&lt;P&gt;The data is much more complex than shown here. &amp;nbsp;I am trying to perform some operations on about 30 variables and which variables will be processed in a given record is dicated by information contained in a separate indicator variable. The macro is supposed to automate this logic.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 23:23:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258671#M49876</guid>
      <dc:creator>gaussian</dc:creator>
      <dc:date>2016-03-23T23:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258676#M49879</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31807"&gt;@gaussian&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;I am trying to perform some operations on about 30 variables and which variables will be processed in a given record is dicated by information contained in a separate indicator variable. .&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This looks like a use of SELECT block:&lt;/P&gt;
&lt;P&gt;Select (indicatorvariable);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; when (1) do; &amp;lt;block of statements to execute when the indicator variable is 1&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; when (2) do; &amp;lt;block of statements to execute when the indicator variable is 2&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; when (3) do; &amp;lt;block of statements to execute when the indicator variable is 3&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; otherwise do; &amp;lt;whatever when indicator has any value except 1, 2 or 3&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;If the indicator is text then the values in the when go in quotes: when ('ABCD')&lt;/P&gt;
&lt;P&gt;Only one of the blocks of code will be done.&lt;/P&gt;
&lt;P&gt;If you have multiple values of the indicator that do the same thing then use: when (1,2,3)&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 23:38:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258676#M49879</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-03-23T23:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258681#M49882</link>
      <description>Arrays will work but I prefer macro programming.</description>
      <pubDate>Wed, 23 Mar 2016 23:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258681#M49882</guid>
      <dc:creator>gaussian</dc:creator>
      <dc:date>2016-03-23T23:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258691#M49888</link>
      <description>&lt;P&gt;Using a sledgehammer for a thumbtack or job security I suppose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is also asked and answered frequently.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://communities.sas.com/t5/Base-SAS-Programming/Create-increment-and-use-a-macro-variable-in-the-same-data-step/m-p/96274/highlight/true#M20300" target="_blank"&gt;http://communities.sas.com/t5/Base-SAS-Programming/Create-increment-and-use-a-macro-variable-in-the-same-data-step/m-p/96274/highlight/true#M20300&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://communities.sas.com/t5/General-SAS-Programming/Resolving-variable-value-as-a-macro-variable-value/m-p/254543/highlight/true#M36270" target="_blank"&gt;http://communities.sas.com/t5/General-SAS-Programming/Resolving-variable-value-as-a-macro-variable-value/m-p/254543/highlight/true#M36270&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why you shouldn't do this:&lt;/P&gt;
&lt;P&gt;1. Hard to read code&lt;/P&gt;
&lt;P&gt;2. Pain to maintain code&lt;/P&gt;
&lt;P&gt;3.&amp;nbsp;Because of #1/2 requires more documentation&lt;/P&gt;
&lt;P&gt;4. If you insist on a method that defies logic it usually means it's homework....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 00:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258691#M49888</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-24T00:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258693#M49889</link>
      <description>&lt;P&gt;Well, there's just one macro tool that will do what you ask. &amp;nbsp;I don't think I'm helping you by telling you this, since all it will do is complicate the program unnecessarily (and you will still end up using arrays anyway).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CALL SYMPUT is a DATA step tool that transfers information from the DATA step to a macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SYMGET is a DATA step tool that transfers in the opposite direction, from a macro variable to a DATA step variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use both in the same DATA step, to transfer information to a macro variable and get it back again later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All that being said, it's the wrong tool for the job. &amp;nbsp;But at least you will get some practice using these tools.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 00:45:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258693#M49889</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-03-24T00:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258746#M49903</link>
      <description>&lt;P&gt;CALL SYMPUT is a data step subroutine that will execute during data step execution time.&lt;/P&gt;
&lt;P&gt;%macro starts a macro definition and will be handled as soon as the % character is encountered when the code is initially read by the main SAS interpreter; this happens &lt;U&gt;before&lt;/U&gt; the data step is even &lt;U&gt;compiled&lt;/U&gt;, and therefore also long before the data step starts executing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Others have already stated that array processing is the way to go with your example; heed their advice. They know what they're talking about.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 07:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258746#M49903</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-03-24T07:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258748#M49904</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31807"&gt;@gaussian&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;The data is much more complex than shown here. &amp;nbsp;I am trying to perform some operations on about 30 variables and which variables will be processed in a given record is dicated by information contained in a separate indicator variable. The macro is supposed to automate this logic.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;The variable that controls which statements need to be executed is part of your data step PDV, so you can use it with data step language tools.&lt;/P&gt;
&lt;P&gt;NO macro processing needed.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 07:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258748#M49904</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-03-24T07:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258751#M49907</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31807"&gt;@gaussian&lt;/a&gt; wrote:&lt;BR /&gt;Arrays will work but I prefer macro programming.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is NOT a matter of preference. Macro language is simply NOT the right tool for this.&lt;/P&gt;
&lt;P&gt;Use a hammer for nails, a screwdriver for screws, and a spanner for nuts.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 08:09:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258751#M49907</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-03-24T08:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258754#M49909</link>
      <description>&lt;P&gt;Let me once again state that having lots of variable will itself complicate things, and lead people out on various hard coded solutions (or in this situation, misuse of macro).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Transpose your data to long.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So your indicator is "v", and then you have "w" that should be used in data transformation.&lt;/P&gt;
&lt;P&gt;This should work just fine with a transposed, normalised table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Storing values as columns is awkward. Leave all your Excel thinking behind.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 08:30:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258754#M49909</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-24T08:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258763#M49913</link>
      <description>&lt;P&gt;I would quite agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH﻿&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser﻿&lt;/a&gt;&amp;nbsp;here. &amp;nbsp;It is a fundemental lack of understanding as to what Macro language is and for. &amp;nbsp;Base SAS is the programming language, this is the one that gets compiled, manipulates and processes data. &amp;nbsp;Macro language does nothing other than generate some text which could be valid Base SAS syntax. &amp;nbsp;I repeat, it is not in any way a programming language in and of itself, only a method of simplfying the amount of text you type. &amp;nbsp;Hence, any program should be written specifically for Base SAS, unless there are very good reason why not. &amp;nbsp;In 99% of these cases where macro is used, it is one of two things - a lack of knowledge of the Base SAS system, or a lack of understanding of the data being used/ability to change its strcuture. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you post some test data, in the form of a dataset, and what you want the output to look like, we can provide Base SAS code, which is both easy to read, maintain, and not obfuscated by macro calls, and assignments.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 09:20:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258763#M49913</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-24T09:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258958#M50004</link>
      <description>&lt;P&gt;I beg to disagree. &amp;nbsp;Macro coding is very common in financial and economic time-series models and data operations. &amp;nbsp;I had worked for several years at a top economic consulting firm and they used extensively macro coding to extend economic variables several months and years into the future. &amp;nbsp;Their legacy SAS code they have dates back to 1-3 decades -- so don't say they don't know what they are doing. Macros are more useful and readable than arrays especially when you have several dozens of time-series indicators you are working with at the same time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have solved my problem using arrays for the time being.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 20:01:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258958#M50004</guid>
      <dc:creator>gaussian</dc:creator>
      <dc:date>2016-03-24T20:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258961#M50007</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31807"&gt;@gaussian&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Their legacy SAS code they have dates back to 1-3 decades -- so don't say they don't know what they are doing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have solved my problem using arrays for the time being.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given the situation you presented, arrays are optimal.&lt;/P&gt;
&lt;P&gt;What was an optimal&amp;nbsp;solution 1 to 3 decades ago, is not the same solution today given the advances in technology.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your question is answered, please mark it as such.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 20:23:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258961#M50007</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-24T20:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258969#M50013</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31807"&gt;@gaussian&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I beg to disagree. &amp;nbsp;Macro coding is very common in financial and economic time-series models and data operations. &amp;nbsp;I had worked for several years at a top economic consulting firm and they used extensively macro coding to extend economic variables several months and years into the future. &amp;nbsp;Their legacy SAS code they have dates back to 1-3 decades -- so don't say they don't know what they are doing. Macros are more useful and readable than arrays especially when you have several dozens of time-series indicators you are working with at the same time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have solved my problem using arrays for the time being.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Having written SAS code nearly 3 decades ago ( starting Fall of 1986) I can say that there have been many changes in SAS. Just because something works does not mean there is not a better way. In the case of macros, especially complex ones, then it often turns out that replacements that are easier to maintain, understand and sometimes just plain faster are available. Remember the macro runs and generates code that is then executed. If you avoid the macro part the overall execution may be much faster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may not quite remember an issue from the late 1990s refered to as Y2k. A major concern was legacy code from mostly &lt;STRONG&gt;major financial institutions&lt;/STRONG&gt; that would not handle dates in the year&amp;nbsp;2000 (or later) correctly.&lt;/P&gt;
&lt;P&gt;It is sometimes&amp;nbsp;a good idea to review processes and see if there are better ways.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 20:56:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258969#M50013</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-03-24T20:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using and Creating Macro Variables in the Same Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258970#M50014</link>
      <description>Arrays are no technological advancement compared to macros and they have coexisted for several decades now. It is purely a matter of how different techniques fit into data structures you are working with. Macros have several advantages while working with time-series data. I have only presented a watered down version of the data I have and while it may seem like arrays are optimal in this case it doesn't mean you completely understand the data I am working with and are able to dish out advises that are universal in nature.</description>
      <pubDate>Thu, 24 Mar 2016 21:00:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-and-Creating-Macro-Variables-in-the-Same-Data-Step/m-p/258970#M50014</guid>
      <dc:creator>gaussian</dc:creator>
      <dc:date>2016-03-24T21:00:30Z</dc:date>
    </item>
  </channel>
</rss>

