<?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: Few Queries . in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Few-Queries/m-p/185267#M35179</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One additional bit about autocall macros: the SAS filename has to match the name of the macro called and best is to only have the code for the macro plus comments in that file. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Sep 2014 14:50:08 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-09-04T14:50:08Z</dc:date>
    <item>
      <title>Few Queries .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Few-Queries/m-p/185264#M35176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. What are Auto call Macro how to create them?&lt;BR /&gt;2. How to create Macro in Global symbol table within Macro parameter?&lt;BR /&gt;3. In a sas session i am having 5 libraries currently i have common dataset CITY (Dset name) i wnat to kill&amp;nbsp; this dataset from all the libraries at once.As in future the no of lib may increase and decrease ased on&amp;nbsp; that session.&lt;BR /&gt;4. Create a table from one library with all datasets with data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 08:41:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Few-Queries/m-p/185264#M35176</guid>
      <dc:creator>sas_Forum</dc:creator>
      <dc:date>2014-09-04T08:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Few Queries .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Few-Queries/m-p/185265#M35177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; They are macro you use all the time, stored in a specific directory, and then used via options sasautos= option, e.g.&lt;/P&gt;&lt;P&gt;libname myautos "c:\myautos";&lt;/P&gt;&lt;P&gt;options sasautos=(myautos);&lt;/P&gt;&lt;P&gt;Just means you don't need to explicitly %include the files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; Not sure what you mean here, macros defined with %let, call symput etc. See the documentation on Scope:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000206835.htm"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000206835.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)&amp;nbsp; Call execute or macro loop:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.vlibnam (where=(substr(LIBNAME1,5)="MY_ID"));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Note I have assumed all libraries will be prefixed with MY_ID, change to your scenario */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call&amp;nbsp; execute('proc datasets library='||strip(libname)||' nolist; delete city; quit;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4)&amp;nbsp; Please clarify what you mean, do you just want new_libname to be a copy?&amp;nbsp; Then:&lt;/P&gt;&lt;P&gt;libname NEW_DATA "...";&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.vtable (where=(libname="OLD_DATA"));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('data NEW_DATA.'||strip(NAME)||'; set OLD_DATA.'||strip(NAME)||'; run;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 08:58:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Few-Queries/m-p/185265#M35177</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-04T08:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Few Queries .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Few-Queries/m-p/185266#M35178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. &lt;A href="https://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a001328769.htm" title="https://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a001328769.htm"&gt;SAS(R) 9.2 Macro Language: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2. %global &lt;EM&gt;variablename&lt;/EM&gt;;&lt;/P&gt;&lt;P&gt;3.:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;do lib_name = 'lib1','lib2',....,'libn';&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute("proc delete data=" !! strip(lib_name) !! ".city;run;");&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Alternatively, you could store your libnames in a dataset and iterate through that.&lt;/P&gt;&lt;P&gt;4.:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select * from dictionary.tables where libname=&lt;EM&gt;'libname&lt;/EM&gt;';&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 09:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Few-Queries/m-p/185266#M35178</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-09-04T09:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Few Queries .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Few-Queries/m-p/185267#M35179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One additional bit about autocall macros: the SAS filename has to match the name of the macro called and best is to only have the code for the macro plus comments in that file. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 14:50:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Few-Queries/m-p/185267#M35179</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-09-04T14:50:08Z</dc:date>
    </item>
  </channel>
</rss>

