<?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 retrieve the source code of a compiled macro? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/838415#M331495</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;If you stored macro in this folder:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;libname mylib '/home/folder/StoredMacros/';&lt;/LI-CODE&gt;
&lt;P&gt;You can&amp;nbsp;&lt;SPAN&gt;recall all macro saved&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;options mstored sasmstore=mylib;&lt;/PRE&gt;
&lt;P&gt;With this proceduce you can print a list of macros from catalog:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc catalog CATALOG=mylib.sasmacr ;
Contents;
run;
quit;&lt;/LI-CODE&gt;
&lt;P&gt;Another option to get a list of macros using a filter on the dictionary alfter calling stored macro(&lt;SPAN&gt;all variable in the DICTIONARY tables is always in uppercase&lt;/SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc sql;
select *
from dictionary.catalogs
where objtype='MACRO' and libname='MYLIB';
quit;&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;You can use "%COPY Statement" to print macro on log or file.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename printmcr '/mysasfile_mymacro.sas';
%copy mymacro / source;
%copy mymacro /OUTFILE=printmcr source;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Oct 2022 15:00:56 GMT</pubDate>
    <dc:creator>Luisfco88</dc:creator>
    <dc:date>2022-10-13T15:00:56Z</dc:date>
    <item>
      <title>How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320093#M70440</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear expert.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to&amp;nbsp;retrieve the source code of a compiled macro, and this macro is compiled without &lt;STRONG&gt;source &amp;amp; secure&lt;/STRONG&gt; option specified.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried to retrieve the code using:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mstored sasmstore=mylib;
libname mylib "mypath";

  filename maccat catalog 'mylib.sasmacr.secure.macro';
  data _null_;
    infile maccat;
    input;
    list;
  run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and the output in log is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CHAR  ....E.......%AHGwinorunix=WIN.... 33
ZONE  000040001000244476667766735440000
NUMR  500050001000518779EF25E98D79E0000
CHAR  &amp;amp;............... 16
ZONE  2000000000000000
NUMR  6000300030000000
CHAR  &amp;amp;............... 16
ZONE  2000000000000000
NUMR  6000400050000000
CHAR  ....E...     %AHGpipe(.dir %AHGaddslash(&amp;amp;dir)..sas .b. );     %AHGpm(rcpipe);.... 81
ZONE  000040002222224447676206672244466676676226672127672160223222222444762767676230000
NUMR  30005000000005187090581492051871443C1388649297E313082209B0000051870D82309059B0000&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This format is not readable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone give me some hints on how to retrieve the source code from compiled macro?&lt;/P&gt;&lt;P&gt;Or try to format the above code into readable SAS program?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 04:46:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320093#M70440</guid>
      <dc:creator>ChaseLiu</dc:creator>
      <dc:date>2016-12-20T04:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320094#M70441</link>
      <description>&lt;P&gt;Please try the mfile option with filename and mprint. The syntax is as follows, when you run it, the file mysasfile.sas will be created and in this the source code of the compiled macro will be saved.&lt;BR /&gt;&lt;BR /&gt; filename mprint 'c:\mysasfile.sas'; &lt;BR /&gt; options mprint mfile; &lt;BR /&gt; run; &lt;BR /&gt;&lt;BR /&gt;%macro test;&lt;BR /&gt;&lt;BR /&gt;your macro code ;&lt;BR /&gt;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;%test;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 04:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320094#M70441</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2016-12-20T04:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320100#M70443</link>
      <description>&lt;P&gt;If your compiled macro was not created with the SOURCE option then unfortunately there is no way to retrieve it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/22/352.html" target="_blank"&gt;http://support.sas.com/kb/22/352.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 06:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320100#M70443</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-12-20T06:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320121#M70455</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN class="login-bold"&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12151" target="_self"&gt;Jagadishkatam&lt;/A&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;I'm afraid your method does not work for me.&lt;BR /&gt;I'd like to see the source code rather than the code beening compiled.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 08:02:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320121#M70455</guid>
      <dc:creator>ChaseLiu</dc:creator>
      <dc:date>2016-12-20T08:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320122#M70456</link>
      <description>That's really sad</description>
      <pubDate>Tue, 20 Dec 2016 08:03:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320122#M70456</guid>
      <dc:creator>ChaseLiu</dc:creator>
      <dc:date>2016-12-20T08:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320152#M70462</link>
      <description>&lt;P&gt;No, that is a really good examplpe of why to avoid proprietary file formats. &amp;nbsp;We had the same thing, years of vendors sending us code hidden in black box compiled catalogs. &amp;nbsp;When 64bit SAS came along these became inaccessible, hence any use of them now has to be re-programmed from the start. &amp;nbsp;So take this as a learning exercise, always use plain text easily transportable file formats that are not tied to any software. &amp;nbsp;We specifically put in all our contracts this now and don't work with those companies who hide things in compiled catalogs or other methods.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 09:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320152#M70462</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-12-20T09:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320174#M70472</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;But you would agree that this isn't really a SAS issue as SAS allows to store the source code with the compiled macro or alternatively also provides the SAS Autocall facility where you don't need to pre-compile the macros at all.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 10:38:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320174#M70472</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-12-20T10:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320180#M70477</link>
      <description>&lt;P&gt;Well, yes, but also no. &amp;nbsp;They do offer methodologies to utilise this in a process and retain the open mentality. &amp;nbsp;However, for the most times I have seen catalogs used, it is to hide code. &amp;nbsp;This may just be a thing in my industry, but its only in recent years that vendors have been more accepting of not hiding their code. &amp;nbsp;Even now, some of what we are sent is hidden in catalogs, and its makes it next to impossible for us to decipher what is going on. &amp;nbsp;With the use of CDISC standards going forward, and the need to provide methodologies, this will have to change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So yes, its not SAS directly, but those compaines who use the tech in this manner. &amp;nbsp;But then you get in to the the cyclic argument of which is the problem, the gun, or the people buying them?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moving on from there, functions are even worse. &amp;nbsp;The code is hidden and the calls to them&amp;nbsp;maskerade as normal functions, not even a % to indicate difference.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 10:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320180#M70477</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-12-20T10:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320437#M70585</link>
      <description>&lt;P&gt;As a general policy I never use SAS compilation options such as macros&amp;nbsp;as I've never found enough advantages to outweigh the disadvantages - like you have found.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 08:45:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/320437#M70585</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-12-21T08:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/542989#M150084</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried your suggested syntax however mprint log couldn't printed in the file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please provide exact way to get mprint print into the file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jai&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 01:42:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/542989#M150084</guid>
      <dc:creator>jaiganesh</dc:creator>
      <dc:date>2019-03-14T01:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/543065#M150118</link>
      <description>&lt;P&gt;Please note this topic is 3 years old.&amp;nbsp; Please open a new post and provide as much details and examples as possible.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 09:41:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/543065#M150118</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-14T09:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/838415#M331495</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;If you stored macro in this folder:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;libname mylib '/home/folder/StoredMacros/';&lt;/LI-CODE&gt;
&lt;P&gt;You can&amp;nbsp;&lt;SPAN&gt;recall all macro saved&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;options mstored sasmstore=mylib;&lt;/PRE&gt;
&lt;P&gt;With this proceduce you can print a list of macros from catalog:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc catalog CATALOG=mylib.sasmacr ;
Contents;
run;
quit;&lt;/LI-CODE&gt;
&lt;P&gt;Another option to get a list of macros using a filter on the dictionary alfter calling stored macro(&lt;SPAN&gt;all variable in the DICTIONARY tables is always in uppercase&lt;/SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc sql;
select *
from dictionary.catalogs
where objtype='MACRO' and libname='MYLIB';
quit;&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;You can use "%COPY Statement" to print macro on log or file.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename printmcr '/mysasfile_mymacro.sas';
%copy mymacro / source;
%copy mymacro /OUTFILE=printmcr source;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 15:00:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/838415#M331495</guid>
      <dc:creator>Luisfco88</dc:creator>
      <dc:date>2022-10-13T15:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/838421#M331497</link>
      <description>&lt;P&gt;Another necro thread.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can only recover the source if the macro was not compiled with the SECURE option.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 15:25:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/838421#M331497</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-13T15:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/838850#M331683</link>
      <description>&lt;P&gt;There is no way to retrieve the original source code from a stored compiled macro&lt;SPAN&gt;. You must always save the original code in another file so that you can modify it later.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards:&amp;nbsp;&lt;A title="How to retrieve the source code of compiled macro" href="https://bestofiron.com/best-steam-irons/" target="_self"&gt;reviews&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 04:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/838850#M331683</guid>
      <dc:creator>fomapi5870</dc:creator>
      <dc:date>2022-10-16T04:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the source code of a compiled macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/894502#M353334</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Retrieving the source code of a compiled macro, such as a CapCut Reels template, is typically not possible. When code is compiled, it's transformed into machine-readable instructions, making it difficult to revert to the original source code. To access the source code, you would need the uncompiled version or the developer's files, which may not be publicly available for templates like CapCut Reels due to copyright and proprietary reasons.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 15 Sep 2023 15:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-the-source-code-of-a-compiled-macro/m-p/894502#M353334</guid>
      <dc:creator>xememo</dc:creator>
      <dc:date>2023-09-15T15:57:43Z</dc:date>
    </item>
  </channel>
</rss>

