<?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: Retrieving a Macro from SAS CATALOG in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Retrieving-a-Macro-from-SAS-CATALOG/m-p/397296#M278239</link>
    <description>&lt;P&gt;Thank you! The Macro files are without % and are not saved by default in Work folder. So as you said this may not be defined with Source and Store options might have been used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to run below code&lt;/P&gt;&lt;PRE&gt;options sasmstore=lib.catalog;
%copy macro / source;&lt;/PRE&gt;&lt;P&gt;- it throws below errors, I am assuming it's because of the reason you specified.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;'ERROR: Invalid logical name'&lt;/P&gt;&lt;P&gt;&amp;nbsp;'ERROR: An error occured during the execution of %COPY statement'&lt;/P&gt;</description>
    <pubDate>Wed, 20 Sep 2017 00:55:36 GMT</pubDate>
    <dc:creator>sredd</dc:creator>
    <dc:date>2017-09-20T00:55:36Z</dc:date>
    <item>
      <title>Retrieving a Macro from SAS CATALOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retrieving-a-Macro-from-SAS-CATALOG/m-p/397258#M278236</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to retrieve code from a SAS catalog. I can view that there are 2 files of macro datatype in the sas catalog &amp;nbsp;I have used below code&lt;/P&gt;&lt;PRE&gt;data _null_;
infile macro;
input;
list;
run;&lt;/PRE&gt;&lt;P&gt;to retrieve a macro file. In the log I can see something like below, is there a way to view the actual SAS code? Please advise, any help is appreciated, Thanks!&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15301i937B43EE0B8C8A45/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 20:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retrieving-a-Macro-from-SAS-CATALOG/m-p/397258#M278236</guid>
      <dc:creator>sredd</dc:creator>
      <dc:date>2017-09-19T20:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving a Macro from SAS CATALOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retrieving-a-Macro-from-SAS-CATALOG/m-p/397263#M278237</link>
      <description>&lt;P&gt;Try %COPY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%copy macro_name / SOURCE;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, if the macro has not been compiled with the SOURCE option I'm not sure you'll get anything useful.&lt;/P&gt;
&lt;P&gt;If the macro was compiled with the SECURE option you WILL NOT be able to reverse engineer the code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any chance you can find the code used to build the macros?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/166209"&gt;@sredd&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to retrieve code from a SAS catalog. I can view that there are 2 files of macro datatype in the sas catalog &amp;nbsp;I have used below code&lt;/P&gt;
&lt;PRE&gt;data _null_;
infile macro;
input;
list;
run;&lt;/PRE&gt;
&lt;P&gt;to retrieve a macro file. In the log I can see something like below, is there a way to view the actual SAS code? Please advise, any help is appreciated, Thanks!&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15301i937B43EE0B8C8A45/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 21:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retrieving-a-Macro-from-SAS-CATALOG/m-p/397263#M278237</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-19T21:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving a Macro from SAS CATALOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retrieving-a-Macro-from-SAS-CATALOG/m-p/397265#M278238</link>
      <description>&lt;P&gt;If the macro wasn't defined with the Source and Store options were used when the macro was compiled you are going to have lots of fun.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might try to see if the options were used:&lt;/P&gt;
&lt;P&gt;%copy &amp;lt;macro&amp;gt;/ library=&amp;lt; the library the macro is in&amp;gt; source;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Macro would NOT include the % and the LIbrary should be other than the default work if used.&lt;/P&gt;
&lt;P&gt;If it works the default behavior will be to write the code of the macro to the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it doesn't you might hope you can find the code that created the macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 21:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retrieving-a-Macro-from-SAS-CATALOG/m-p/397265#M278238</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-19T21:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving a Macro from SAS CATALOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retrieving-a-Macro-from-SAS-CATALOG/m-p/397296#M278239</link>
      <description>&lt;P&gt;Thank you! The Macro files are without % and are not saved by default in Work folder. So as you said this may not be defined with Source and Store options might have been used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to run below code&lt;/P&gt;&lt;PRE&gt;options sasmstore=lib.catalog;
%copy macro / source;&lt;/PRE&gt;&lt;P&gt;- it throws below errors, I am assuming it's because of the reason you specified.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;'ERROR: Invalid logical name'&lt;/P&gt;&lt;P&gt;&amp;nbsp;'ERROR: An error occured during the execution of %COPY statement'&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 00:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retrieving-a-Macro-from-SAS-CATALOG/m-p/397296#M278239</guid>
      <dc:creator>sredd</dc:creator>
      <dc:date>2017-09-20T00:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving a Macro from SAS CATALOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retrieving-a-Macro-from-SAS-CATALOG/m-p/397465#M278240</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/166209"&gt;@sredd&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you! The Macro files are without % and are not saved by default in Work folder. So as you said this may not be defined with Source and Store options might have been used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I try to run below code&lt;/P&gt;
&lt;PRE&gt;options sasmstore=lib.catalog;
%copy macro / source;&lt;/PRE&gt;
&lt;P&gt;- it throws below errors, I am assuming it's because of the reason you specified.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;'ERROR: Invalid logical name'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;'ERROR: An error occured during the execution of %COPY statement'&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It may be that you requested the name of a macro that did not exist. Or possibly it is with the SASMSTORE option.&lt;/P&gt;
&lt;P&gt;With errors it is best to post the code and the error message from the log into a forum code box. Sometimes the error message format will indicate where the error was detected but with the code the message is incomplete.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 14:48:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retrieving-a-Macro-from-SAS-CATALOG/m-p/397465#M278240</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-20T14:48:50Z</dc:date>
    </item>
  </channel>
</rss>

