<?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: Print Macro value to output window in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Print-Macro-value-to-output-window/m-p/71739#M15522</link>
    <description>It works!&lt;BR /&gt;
%macro test;&lt;BR /&gt;
data _null_ ;&lt;BR /&gt;
        * to print the value of macro variable named in &amp;amp;var;&lt;BR /&gt;
         file print ;&lt;BR /&gt;
         put "&amp;amp;var="  "&amp;amp;&amp;amp;&amp;amp;var" ;&lt;BR /&gt;
         stop ;&lt;BR /&gt;
      run;&lt;BR /&gt;
	  %mend test;&lt;BR /&gt;
	  %test;</description>
    <pubDate>Thu, 29 Jan 2009 20:02:49 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2009-01-29T20:02:49Z</dc:date>
    <item>
      <title>Print Macro value to output window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Print-Macro-value-to-output-window/m-p/71737#M15520</link>
      <description>How to print the macro value after it is resolved to output window. Usually we see it in the log window.</description>
      <pubDate>Thu, 29 Jan 2009 18:57:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Print-Macro-value-to-output-window/m-p/71737#M15520</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2009-01-29T18:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Print Macro value to output window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Print-Macro-value-to-output-window/m-p/71738#M15521</link>
      <description>would this be satisfactory?[pre]      data _null_ ;&lt;BR /&gt;
        * to print the value of macro variable named in &amp;amp;var;&lt;BR /&gt;
         file print ;&lt;BR /&gt;
         put "&amp;amp;var="  "&amp;amp;&amp;amp;&amp;amp;var" ;&lt;BR /&gt;
         stop ;&lt;BR /&gt;
      run;[/pre]Or, to print the values of all, with their current scope[pre]      proc sort data= sashelp.vmacro out= _data_  ;&lt;BR /&gt;
         by scope name offset ;&lt;BR /&gt;
      run ;&lt;BR /&gt;
      proc print ;&lt;BR /&gt;
         by scope ;&lt;BR /&gt;
         id name ;&lt;BR /&gt;
        var offset value ;&lt;BR /&gt;
      run;[/pre]&lt;BR /&gt;
&lt;BR /&gt;
try it to see.&lt;BR /&gt;
&lt;BR /&gt;
PeterC</description>
      <pubDate>Thu, 29 Jan 2009 19:51:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Print-Macro-value-to-output-window/m-p/71738#M15521</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-29T19:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Print Macro value to output window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Print-Macro-value-to-output-window/m-p/71739#M15522</link>
      <description>It works!&lt;BR /&gt;
%macro test;&lt;BR /&gt;
data _null_ ;&lt;BR /&gt;
        * to print the value of macro variable named in &amp;amp;var;&lt;BR /&gt;
         file print ;&lt;BR /&gt;
         put "&amp;amp;var="  "&amp;amp;&amp;amp;&amp;amp;var" ;&lt;BR /&gt;
         stop ;&lt;BR /&gt;
      run;&lt;BR /&gt;
	  %mend test;&lt;BR /&gt;
	  %test;</description>
      <pubDate>Thu, 29 Jan 2009 20:02:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Print-Macro-value-to-output-window/m-p/71739#M15522</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2009-01-29T20:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Print Macro value to output window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Print-Macro-value-to-output-window/m-p/71740#M15523</link>
      <description>Rather than examine macro variable values in the output window, I just press a function key programmed to show my version of SASHELP.VMACRO in a viewtable window (or whenever the client's licence permits, in an FSview window because customising that is simpler) . The command is just [pre]             vt sashelp.vmacro colheading=name[/pre]&lt;BR /&gt;
I prefer the list to be ordered, so keep a view in my sasuser folder that is similar to the SASHELP.VMACRO view[pre]      proc sql  ;&lt;BR /&gt;
        create view sasuser.vmacro as&lt;BR /&gt;
              select scope as s format=$2.&lt;BR /&gt;
                   , name       format=$15.&lt;BR /&gt;
                   , offset/200 as off format= 3.&lt;BR /&gt;
                   , value      format= $40.&lt;BR /&gt;
                   , scope&lt;BR /&gt;
                   , offset&lt;BR /&gt;
                from sashelp.vmacro&lt;BR /&gt;
            order by scope descending, name, offset&lt;BR /&gt;
                    ;&lt;BR /&gt;
      quit ;[/pre] The differences I introduced are as follows:&lt;BR /&gt;
To most quickly locate any macro variable, I prefer the view to list names in order. Sorting first by "scope descending" places my macro variables before those which are automatic. If I should use this view within a macro, SCOPE names the macro in which each macro var was created.  As sashelp.VMACRO predates SAS7 the 200 width limit is respected and a wide value is broken in 200 byte chunks and OFFSET is the real offset. Providing a narrower space for that value in my window, my view divides offfset by 200. &lt;BR /&gt;
&lt;BR /&gt;
Then rather than submit code to review macro variable values, I just press a function key that issues command [pre]             vt sasuser.vmacro colheading=name[/pre] or [pre]             fsview sasuser.vmacro ; formula [/pre] ("formula" command in an FSView window retrieves customisation I prepared earlier, controlling window contents - column sizes, colors and order, and window size &amp;amp; position.&lt;BR /&gt;
Some users like a mouse alternative to function keys, and prepare the command behind a new icon they create in the toolbar. Then they can easily view the current state of all macro variables at the touch of a button.&lt;BR /&gt;
I guess (hope) there is something similar with E.G.&lt;BR /&gt;
&lt;BR /&gt;
PeterC</description>
      <pubDate>Thu, 29 Jan 2009 20:49:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Print-Macro-value-to-output-window/m-p/71740#M15523</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-29T20:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Print Macro value to output window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Print-Macro-value-to-output-window/m-p/619805#M182051</link>
      <description>&lt;P&gt;BIG THANKS to all ideas!&lt;BR /&gt;I solved it by including my statements into a dataset, but I can't understand why my initial version works for only a few people.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 12:53:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Print-Macro-value-to-output-window/m-p/619805#M182051</guid>
      <dc:creator>kiranp</dc:creator>
      <dc:date>2020-01-24T12:53:10Z</dc:date>
    </item>
  </channel>
</rss>

