<?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 to store_user_ in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-store-user/m-p/371054#M88636</link>
    <description>&lt;P&gt;What are you going to do with the results?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that there exists a data view you can address as SASHELP.Vmacro or&amp;nbsp;with proc sql&amp;nbsp;Dictionary.Macros that contains all of the macro variable definitions at the time you inspect. The following will have all variables. Add Where Scope ne 'AUTOMATIC' to get the macro variables you declared.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set sashelp.vamacro;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;Proc Sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table want as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dictionary.macros&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2017 21:13:53 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-06-27T21:13:53Z</dc:date>
    <item>
      <title>how to store_user_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-store-user/m-p/371049#M88632</link>
      <description>&lt;P&gt;How to save _user_ defined macro into a dataset? read the text file created below?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc printto log="c:\temp\testlog.txt";
run;
%put _user_;
proc printto ;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 20:50:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-store-user/m-p/371049#M88632</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2017-06-27T20:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to store_user_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-store-user/m-p/371053#M88635</link>
      <description>&lt;P&gt;You would be better off using existing tools for this purpose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use PROC SQL to take a look at dictionary.macros ... you should find all macro variables there, with fields that identify which ones are user-created.&amp;nbsp; It should be easy enough to save a subset of that, as a SAS data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The one tricky part:&amp;nbsp; macro variables that are longer than 200 characters are saved in 200-character chunks, across multiple observations.&amp;nbsp; Of course with your %PUT _USER_ statement, those would pose a problem as well.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 21:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-store-user/m-p/371053#M88635</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-06-27T21:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to store_user_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-store-user/m-p/371054#M88636</link>
      <description>&lt;P&gt;What are you going to do with the results?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that there exists a data view you can address as SASHELP.Vmacro or&amp;nbsp;with proc sql&amp;nbsp;Dictionary.Macros that contains all of the macro variable definitions at the time you inspect. The following will have all variables. Add Where Scope ne 'AUTOMATIC' to get the macro variables you declared.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set sashelp.vamacro;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;Proc Sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table want as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dictionary.macros&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 21:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-store-user/m-p/371054#M88636</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-27T21:13:53Z</dc:date>
    </item>
  </channel>
</rss>

