<?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 SAS Macros in a permanent Library in Developers</title>
    <link>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/596156#M5946</link>
    <description>You are missing the keyword MACRO in the first line.&lt;BR /&gt;%macro MyMac(dsname);&lt;BR /&gt;</description>
    <pubDate>Mon, 14 Oct 2019 05:11:32 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-10-14T05:11:32Z</dc:date>
    <item>
      <title>How to store SAS Macros in a permanent Library</title>
      <link>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595386#M5937</link>
      <description>&lt;P&gt;How to store SAS Macros in a permanent Library?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;%macro import(set,sh,op);&lt;BR /&gt;proc import datafile="D:\SAS Docs\CDM Docs\Protocol.xlsx" dbms=xlsx out=&amp;amp;set replace;&lt;BR /&gt;sheet=&amp;amp;sh;&lt;BR /&gt;getnames=&amp;amp;op;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=&amp;amp;set;run;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;This is a macro but it is getting stored in Work Library. I want to store it in a permanent Library. How?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 13:32:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595386#M5937</guid>
      <dc:creator>Rakesh93</dc:creator>
      <dc:date>2019-10-10T13:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to store SAS Macros in a permanent Library</title>
      <link>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595389#M5938</link>
      <description>&lt;P&gt;Store the macro as code in your &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=n1o5fkxq0gqdpcn1xs3ksdks69tf.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;autocall&lt;/A&gt; library.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 13:41:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595389#M5938</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-10T13:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to store SAS Macros in a permanent Library</title>
      <link>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595393#M5939</link>
      <description>&lt;P&gt;It is possible to store COMPILED macros into catalogs and tell SAS to look for them there.&lt;/P&gt;
&lt;P&gt;But it is much easier to create and manage if you use the SASAUTOS facility instead.&amp;nbsp; Use the SASAUTOS option to point to a folder (or series of folders) where SAS can look for an auto-compile the macro from the source.&amp;nbsp; Place each macro in its own individual file. Name the file with the name of the macro with .sas extension. Make sure to use lowercase letters for the filename.&amp;nbsp; So your example should be stored in a file named import.sas.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 13:46:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595393#M5939</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-10T13:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to store SAS Macros in a permanent Library</title>
      <link>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595473#M5940</link>
      <description>Can you explain with an example?&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Oct 2019 16:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595473#M5940</guid>
      <dc:creator>Rakesh93</dc:creator>
      <dc:date>2019-10-10T16:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to store SAS Macros in a permanent Library</title>
      <link>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595484#M5941</link>
      <description>&lt;P&gt;Read the documentation that I linked in my previous post. If you have specific questions, ask them.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 16:36:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595484#M5941</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-10T16:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to store SAS Macros in a permanent Library</title>
      <link>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595639#M5942</link>
      <description>&lt;P&gt;Please explain the Syntax of Sasautos in SAS environment.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 06:24:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595639#M5942</guid>
      <dc:creator>Rakesh93</dc:creator>
      <dc:date>2019-10-11T06:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to store SAS Macros in a permanent Library</title>
      <link>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595645#M5943</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/294186"&gt;@Rakesh93&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Please explain the Syntax of Sasautos in SAS environment.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p12b2qq72dkxpsn1e19y57emerr6.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;SASAUTOS System Option&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 06:38:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595645#M5943</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-11T06:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to store SAS Macros in a permanent Library</title>
      <link>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595686#M5944</link>
      <description>&lt;P&gt;Make a directory on you filesystem.&amp;nbsp; For example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/home/me/sas_macros/&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Make a macro and store it in a file in that directory.&amp;nbsp; For example a macro name %MyMac() might be in a file named.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/home/me/sas_macros/mymac.sas&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And have content like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro MyMac(dsname);
proc contents data=&amp;amp;dsname;
run;
%mend MyMac;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then in your main program add this line to tell SAS where to find the macros:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options insert=(sasautos=('/home/me/sas_macro'));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And then after than in your main program you just call the macro.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%mymac(sashelp.class)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you have called it before it just runs, but if not then SAS will search the folders in the SASAUTOS option tor the file named 'mymac.sas' and include it.&amp;nbsp; &amp;nbsp;Then, now that the macro has been compiled, it calls it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 11:58:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/595686#M5944</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-11T11:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to store SAS Macros in a permanent Library</title>
      <link>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/596153#M5945</link>
      <description>While running this file:&lt;BR /&gt;&lt;BR /&gt;%MyMac(dsname);&lt;BR /&gt;proc contents data=&amp;amp;dsname;&lt;BR /&gt;run;&lt;BR /&gt;%mend MyMac;&lt;BR /&gt;&lt;BR /&gt;It shows no matching macro with mend.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Oct 2019 04:38:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/596153#M5945</guid>
      <dc:creator>Rakesh93</dc:creator>
      <dc:date>2019-10-14T04:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to store SAS Macros in a permanent Library</title>
      <link>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/596156#M5946</link>
      <description>You are missing the keyword MACRO in the first line.&lt;BR /&gt;%macro MyMac(dsname);&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Oct 2019 05:11:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-store-SAS-Macros-in-a-permanent-Library/m-p/596156#M5946</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-14T05:11:32Z</dc:date>
    </item>
  </channel>
</rss>

