<?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: remove macro variables defined by user in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/remove-macro-variables-defined-by-user/m-p/687751#M208827</link>
    <description>&lt;P&gt;Check out the `%symdel` statement, doc. here:&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p1vtk6flp9vpfzn14kkxolcnggzy.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p1vtk6flp9vpfzn14kkxolcnggzy.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 09:10:44 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2020-09-30T09:10:44Z</dc:date>
    <item>
      <title>remove macro variables defined by user</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-macro-variables-defined-by-user/m-p/687750#M208826</link>
      <description>&lt;P&gt;hello&lt;/P&gt;
&lt;P&gt;how could I delete all macro variables defined by user during program execution&lt;/P&gt;
&lt;P&gt;thanks in advance for your help&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Nass&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 09:08:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-macro-variables-defined-by-user/m-p/687750#M208826</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2020-09-30T09:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: remove macro variables defined by user</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-macro-variables-defined-by-user/m-p/687751#M208827</link>
      <description>&lt;P&gt;Check out the `%symdel` statement, doc. here:&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p1vtk6flp9vpfzn14kkxolcnggzy.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p1vtk6flp9vpfzn14kkxolcnggzy.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 09:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-macro-variables-defined-by-user/m-p/687751#M208827</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-09-30T09:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: remove macro variables defined by user</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-macro-variables-defined-by-user/m-p/687752#M208828</link>
      <description>Thanks Bart for your quick respons&lt;BR /&gt;but I would like to delete without specifying the variables names.&lt;BR /&gt;then I could call the same command for programmes without knowing the varaibles names.&lt;BR /&gt;thanks</description>
      <pubDate>Wed, 30 Sep 2020 09:18:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-macro-variables-defined-by-user/m-p/687752#M208828</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2020-09-30T09:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: remove macro variables defined by user</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-macro-variables-defined-by-user/m-p/687757#M208831</link>
      <description>&lt;P&gt;you could try with something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let a = 1;
%let b = 2;
%let c = 3;


options notes source;

%macro symdelALL();
%local _OPTIONS_ _TEMPFILE_;
%let _OPTIONS_ = %sysfunc(getoption(notes)) %sysfunc(getoption(source));
%let _TEMPFILE_ = _%sysfunc(datetime(),hex7.);
options NOnotes NOsource;
filename &amp;amp;_TEMPFILE_. TEMP lrecl = 512;

proc printto log = &amp;amp;_TEMPFILE_.;
run;
%put _user_;
proc printto log = log;
run;

data _null_;
  length vname $ 2048;
  retain vname " ";
  infile &amp;amp;_TEMPFILE_. lrecl = 512 end=EOF;
  input;
  if "GLOBAL" =: _infile_ then vname=catx(" ", vname, scan(_INFILE_,2," "));
  if EOF then call execute('%nrstr(%symdel ' || strip(vname) || " / nowarn;)");
run;
filename &amp;amp;_TEMPFILE_.;
options &amp;amp;_OPTIONS_.;
%mend symdelALL;

%put _user_;
%symdelALL()
%put _user_;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 09:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-macro-variables-defined-by-user/m-p/687757#M208831</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-09-30T09:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: remove macro variables defined by user</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-macro-variables-defined-by-user/m-p/687758#M208832</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can take a look at the sashelp.vmacro view and adapt the following program to your needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x=1;
%let y=hello;

data _NULL_;
set sashelp.vmacro(where=(scope='GLOBAL'));
call execute(catx(' ','%nrstr(%symdel)',name,';'));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 09:38:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-macro-variables-defined-by-user/m-p/687758#M208832</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2020-09-30T09:38:33Z</dc:date>
    </item>
  </channel>
</rss>

