<?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 SAS program to write the values of all local variables to the log in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233026#M268139</link>
    <description>&lt;P&gt;SAS program to write the values of all local variables to the log using do loop in a macro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Nov 2015 09:00:29 GMT</pubDate>
    <dc:creator>RTelang</dc:creator>
    <dc:date>2015-11-04T09:00:29Z</dc:date>
    <item>
      <title>SAS program to write the values of all local variables to the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233026#M268139</link>
      <description>&lt;P&gt;SAS program to write the values of all local variables to the log using do loop in a macro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 09:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233026#M268139</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2015-11-04T09:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to write the values of all local variables to the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233031#M268140</link>
      <description>&lt;P&gt;It doesn't make much sense to have a do - loop, just do:&lt;/P&gt;
&lt;P&gt;%put _local_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To test:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro tmp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %local temp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %let temp=abc;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %put _local_;&lt;/P&gt;
&lt;P&gt;%mend tmp;&lt;/P&gt;
&lt;P&gt;%tmp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 10:09:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233031#M268140</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-04T10:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to write the values of all local variables to the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233077#M268141</link>
      <description>&lt;P&gt;Completely agree. Can't see what&amp;nbsp;a DO loop may accomplish. The %put _local_ line of SAS code will give you the information you asked for in the log file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can tell us a little more about why you had considered/asked to have this done using a DO loop.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 14:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233077#M268141</guid>
      <dc:creator>MaikH_Schutze</dc:creator>
      <dc:date>2015-11-04T14:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to write the values of all local variables to the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233207#M268142</link>
      <description>&lt;P&gt;%let a=10 b=12 c=15;&lt;BR /&gt;%macro test(varlist=a b c test1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hi Schutze this is the example am talking about,&lt;/P&gt;
&lt;P&gt;a b c values are defined so using varlist parameter i have to access these values &amp;amp; display the in the log with their respective variables.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 06:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233207#M268142</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2015-11-05T06:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to write the values of all local variables to the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233208#M268143</link>
      <description>&lt;P&gt;%let a=10 b=12 c=15;&lt;BR /&gt;%macro test(varlist=a b c test1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hello&amp;nbsp;RW9&amp;nbsp;this is the example am talking about,&lt;/P&gt;
&lt;P&gt;a b c values are defined so using varlist parameter i have to access these values &amp;amp; display&lt;/P&gt;
&lt;P&gt;the in the log with their respective variables. thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 06:50:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233208#M268143</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2015-11-05T06:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to write the values of all local variables to the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233210#M268144</link>
      <description>%let a=10 b=12 c=15;&lt;BR /&gt;%macro test(varlist=a b c test1);&lt;BR /&gt;string=(varlist= a b c test1);&lt;BR /&gt;%do varlist=&amp;amp;a %to test1;&lt;BR /&gt;&lt;BR /&gt;%put _local_ ;&lt;BR /&gt;%end;&lt;BR /&gt;%mend test;&lt;BR /&gt;options symbolgen mprint;&lt;BR /&gt;%test&lt;BR /&gt;&lt;BR /&gt;will this work or retify it!&lt;BR /&gt;i want to display varlist= a b c test1 to the log with their values</description>
      <pubDate>Thu, 05 Nov 2015 06:55:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233210#M268144</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2015-11-05T06:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to write the values of all local variables to the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233215#M268145</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ok, lets start this again. &amp;nbsp;Start from the beginning, not half way through. &amp;nbsp;What is it your trying to do. &amp;nbsp;I do not see any reason why you would be passing a list of macro variables into a macro via a macro variable. &amp;nbsp;This seems totally illogical. In theory you could use the metadata table to print to log:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let a=10 b=12 c=15;
%macro test(varlist=a b c test1);
  proc print data=sashelp.vmacro;
  run;
%mend test;
%test;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, if you run this you will see that &amp;amp;A is the only macro variable created in the first statement, and it represents the text: "10 b=12 c=15". &amp;nbsp;What I would suggest is that you go back and have a look at what macros/variables are, and how they work, as what you are doing doesn't make sense.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 09:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233215#M268145</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-05T09:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to write the values of all local variables to the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233218#M268146</link>
      <description>k thanks&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Nov 2015 09:12:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233218#M268146</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2015-11-05T09:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to write the values of all local variables to the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233390#M268147</link>
      <description>&lt;P&gt;Are you talking about macro variables? If so then it's very easy.&lt;/P&gt;
&lt;P&gt;You don't need below in a macro do loop as these reserved keywords will access all macro variables in scope.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put _local_;
%put _global_;
%put _automatic_;
%put _all_;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively you can also query the macro dictionary table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  select * from dictionary.macros
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 08:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/233390#M268147</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-11-06T08:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to write the values of all local variables to the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/234836#M268148</link>
      <description>i want to reference this  &lt;BR /&gt;%let a=10 b=12 c=15;&lt;BR /&gt;%macro test(varlist=a b c test1);&lt;BR /&gt;in my macro code and display this &amp;amp;a &amp;amp;b &amp;amp;c &amp;amp;test1 in the log with their respective values&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Nov 2015 08:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/234836#M268148</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2015-11-16T08:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to write the values of all local variables to the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/234839#M268149</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please read my post thoroughly, and run the code given. &amp;nbsp;You don't seem to understand how macros work. &amp;nbsp;This code:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%let a=10 b=12 c=15;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Creates a macro variable called a which contains the string "10 b=12 c=15".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Secondly, what is it your trying to do, why do you have a macro parameter with a list of what I assume from the text is variables, and yet seem to want to use them as macro variables? &amp;nbsp;Please state what you are doing, post datastep test data and required output, as the code provided makes no sense.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2015 08:48:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/234839#M268149</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-16T08:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to write the values of all local variables to the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/234957#M268150</link>
      <description>i have to take the list &amp;amp; count each value separately and display individual value to the log. i do understand macros but am stuck at this program.</description>
      <pubDate>Tue, 17 Nov 2015 06:34:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-write-the-values-of-all-local-variables-to-the/m-p/234957#M268150</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2015-11-17T06:34:12Z</dc:date>
    </item>
  </channel>
</rss>

