<?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 macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-variable/m-p/802109#M315739</link>
    <description>&lt;P&gt;hi if I have created a macro variable using the code included, how can I indicate this variable is a macro variable in other sas program? or the only time I will recall it is to using it as &amp;amp;total_dev where it is now a value assigned...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what I really mean is how to indicate a variable is macro but not calling it with &amp;amp; where a value is assigned..&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql noprint
select distinct
count(*) into :total_dev
from &amp;amp;Portofo._dev;
quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Mar 2022 04:34:52 GMT</pubDate>
    <dc:creator>HeatherNewton</dc:creator>
    <dc:date>2022-03-15T04:34:52Z</dc:date>
    <item>
      <title>macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable/m-p/802109#M315739</link>
      <description>&lt;P&gt;hi if I have created a macro variable using the code included, how can I indicate this variable is a macro variable in other sas program? or the only time I will recall it is to using it as &amp;amp;total_dev where it is now a value assigned...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what I really mean is how to indicate a variable is macro but not calling it with &amp;amp; where a value is assigned..&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql noprint
select distinct
count(*) into :total_dev
from &amp;amp;Portofo._dev;
quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 04:34:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable/m-p/802109#M315739</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-03-15T04:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable/m-p/802115#M315743</link>
      <description>&lt;P&gt;A macro variable is called by using the &amp;amp; macro trigger. Please indicate why you would not want to do this or why it would not work in your given use case.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 05:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable/m-p/802115#M315743</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-15T05:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable/m-p/802123#M315751</link>
      <description>&lt;P&gt;oh I was trying to describe it in a document and wonder if there are any good ways apart from saying it in words that it is a macro variable&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 07:09:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable/m-p/802123#M315751</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-03-15T07:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable/m-p/802124#M315752</link>
      <description>&lt;P&gt;You always have to make clear to the SAS interpreter that it has to call the macro preprocessor to resolve the macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are interfaces between "normal" SAS code and the macro facility that allow dynamic creation and retrieval of macro variables, namely the CALL SYMPUT(X) subroutines and the SYMGET function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set sashelp.class (obs=1);
call symputx('name',name); /* store the contents of data step/dataset variable name into macro variable name */
run;

%put &amp;amp;=name.;

data _null_;
name = symget('name'); /* assign the contents of macro variable name to data step variable name */
put name=;
run;

data class;
set sashelp.class;
if _n_ = 1 then call symputx('name',name);
if _n_ = 10 then name = symget('name');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The latter example is just for illustration, you would usually use a retained variable for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you already know the INTO keyword in SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 07:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable/m-p/802124#M315752</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-15T07:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable/m-p/802147#M315767</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm confused, in your question you say "how can I indicate this variable is a macro variable &lt;U&gt;in other sas program&lt;/U&gt;?", but in your next post you say "&lt;SPAN&gt;I was trying to describe it &lt;U&gt;in a document&lt;/U&gt;&lt;/SPAN&gt;". So are you asking how to indicate the macro variable name is a macro in a SAS program - in which case would a comment work - or are you asking how to indicate this in some kind of text document (i.e., not a SAS program) where you don't want to use the words "macro variable" (which is exactly what it is) - in which case would "store", "storage", "memory", etc. do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are the people who might read what you are trying to create familiar with SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think more context is required. Perhaps show us where / how you want to use it and what you want to have changed to something else.&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;Kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 10:51:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable/m-p/802147#M315767</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2022-03-15T10:51:23Z</dc:date>
    </item>
  </channel>
</rss>

