<?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 Save the program in a SOURCE entry in the SAS catalog in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299943#M1164</link>
    <description>&lt;P&gt;Hullo&lt;/P&gt;&lt;P&gt;Good people, am doing a tutorial where i need to write a macro program then &lt;SPAN&gt;Save the program in a SOURCE entry in the SAS catalog &lt;/SPAN&gt;&lt;STRONG&gt;Sasuser.Mymacs&lt;/STRONG&gt;&lt;SPAN&gt;. (You might need to create the &lt;/SPAN&gt;&lt;STRONG&gt;Mymacs&lt;/STRONG&gt;&lt;SPAN&gt; catalog before you save the SOURCE entry in it.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;my question is how can i create a folder , or wht are the steps to create a folder in a SOURCE entry in the SAS catalog using SAS University Edition, and then how to I save the macro there.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Sep 2016 19:37:13 GMT</pubDate>
    <dc:creator>Muwanguzi</dc:creator>
    <dc:date>2016-09-21T19:37:13Z</dc:date>
    <item>
      <title>Save the program in a SOURCE entry in the SAS catalog</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299943#M1164</link>
      <description>&lt;P&gt;Hullo&lt;/P&gt;&lt;P&gt;Good people, am doing a tutorial where i need to write a macro program then &lt;SPAN&gt;Save the program in a SOURCE entry in the SAS catalog &lt;/SPAN&gt;&lt;STRONG&gt;Sasuser.Mymacs&lt;/STRONG&gt;&lt;SPAN&gt;. (You might need to create the &lt;/SPAN&gt;&lt;STRONG&gt;Mymacs&lt;/STRONG&gt;&lt;SPAN&gt; catalog before you save the SOURCE entry in it.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;my question is how can i create a folder , or wht are the steps to create a folder in a SOURCE entry in the SAS catalog using SAS University Edition, and then how to I save the macro there.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 19:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299943#M1164</guid>
      <dc:creator>Muwanguzi</dc:creator>
      <dc:date>2016-09-21T19:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Save the program in a SOURCE entry in the SAS catalog</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299964#M1166</link>
      <description>&lt;P&gt;This is what you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Define where macros will be stored;
option mstored sasmstore=mymacros;
*Create library myMacros so that it exists;
libname myMacros '/folders/myfolders/';

*Run macro with SOURCE/STORE so it is stored in catalog;
%macro HelloWorld() / store source;
    data _null_;
        put "Hello, World!";
    run;
%mend;


*Retrieve macro code - shows in log;
%copy helloworld / source;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/39513623/sas-how-do-i-store-a-macro-in-a-catalog" target="_blank"&gt;http://stackoverflow.com/questions/39513623/sas-how-do-i-store-a-macro-in-a-catalog&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://analytics.ncsu.edu/sesug/2005/AD07_05.PDF" target="_blank"&gt;http://analytics.ncsu.edu/sesug/2005/AD07_05.PDF&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 20:34:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299964#M1166</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-21T20:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Save the program in a SOURCE entry in the SAS catalog</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299966#M1167</link>
      <description>&lt;P&gt;SAS catalogs are not easily managed from SAS UE aka SAS Studio. Most SAS users don't store SAS programs in catalogs these days. I suggest you just store it as an external text file.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 20:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299966#M1167</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-09-21T20:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Save the program in a SOURCE entry in the SAS catalog</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299968#M1168</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi﻿&lt;/a&gt;. The usual method is to create a link to a folder where the macros are compiled when SAS starts up you can specify the folders in your AutoExec.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, my guess, based on the wording of the question is that this is homework.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 20:39:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299968#M1168</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-21T20:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Save the program in a SOURCE entry in the SAS catalog</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299970#M1170</link>
      <description>&lt;P&gt;I'm using SAS Univerisity Edition too.&lt;/P&gt;&lt;P&gt;I have tried to load a source into a catalog and couldn't find a way to do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS UE is limited and I have the feeling it is not posssible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On unlimited version you can do &lt;STRONG&gt;SAVE AS&lt;/STRONG&gt; and save the source from the program editor to a catalog&lt;/P&gt;&lt;P&gt;by defining target as: &lt;STRONG&gt;&amp;nbsp;&amp;lt;libref&amp;gt;.&amp;lt;cat_name&amp;gt;.&amp;lt;source_name&amp;gt;.SOURCE&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 20:55:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299970#M1170</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-21T20:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Save the program in a SOURCE entry in the SAS catalog</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299971#M1171</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;The code above was run on SAS UE and worked.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 20:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299971#M1171</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-21T20:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Save the program in a SOURCE entry in the SAS catalog</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299972#M1172</link>
      <description>&lt;P&gt;Reeza, thank you. The use of&lt;STRONG&gt; / options&lt;/STRONG&gt; on &lt;STRONG&gt;%macro&lt;/STRONG&gt; statement is new for me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 20:58:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299972#M1172</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-21T20:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Save the program in a SOURCE entry in the SAS catalog</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299990#M1173</link>
      <description>Sure &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; it did run and thats because yu stored it Using Stored Compiled Macros , what am trying to do is store Macro Definitions in Catalog SOURCE Entries.&lt;BR /&gt;the instructions for windows OS , say yu use the Save As Object window.&lt;BR /&gt;Select File &amp;gt; Save As Object. In the Save As Object window, select the Sasuser library.&lt;BR /&gt;&lt;BR /&gt;If the Sasuser.Mymacs catalog does not already exist, you need to create it. You can either select the Create New Catalog icon or right-click the Save As Object window and select New in order to open the New Catalog window.&lt;BR /&gt;Enter Mymacs as the name for the new catalog and click OK.&lt;BR /&gt;&lt;BR /&gt;Enter Printit in the Entry Name field. Make sure that the Entry Type is set to SOURCE entry (SOURCE), then click Save.&lt;BR /&gt;I HOPE THIS IS A BETTER EXPLANATION.&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Sep 2016 22:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299990#M1173</guid>
      <dc:creator>Muwanguzi</dc:creator>
      <dc:date>2016-09-21T22:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Save the program in a SOURCE entry in the SAS catalog</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299991#M1174</link>
      <description>&lt;P&gt;And if you have Base SAS you can do that. SAS Studio doesn't offer that same functionality AFAIK.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, in SAS UE you can't save to SASUSER folder.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can extract the source code as in the last line, so don't you have the same functionality?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 22:23:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/299991#M1174</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-21T22:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: Save the program in a SOURCE entry in the SAS catalog</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/300570#M1198</link>
      <description>&lt;P&gt;To give you some historical context, storing SAS code in SAS catalogs used to be quite common 15 or more years ago when SAS users only had complete SAS installations on their PCs and the SAS Windowing System AKA Display Manager was the dominant interface.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Users built complete windowing applications using SAS/AF software with the SCL applications and SAS source code developed stored in SAS catalogs. With the move to thin client interfaces, particularly now web-based ones, use of SAS catalogs for storing applications and code is pretty much obsolete. They are still relevant however for storing SAS formats. This explains why there is no functionality to store SAS code in SAS catalogs in SAS's thin client tools like EG and SAS Studio.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC CATALOG and DATASETS are really the only ways to interact with SAS catalogs in SAS Studio. You can delete, copy, rename catalog members but you can't save SOURCE entries. PROC FORMAT creates format-type entries like FORMATC, FORMATN etc. &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Sep 2016 23:42:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/300570#M1198</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-09-24T23:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Save the program in a SOURCE entry in the SAS catalog</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/300575#M1199</link>
      <description>&lt;P&gt;On SAS UE I succeded to store a macro into a catalog without to predefine it,&amp;nbsp;&lt;/P&gt;&lt;P&gt;using the method&amp;nbsp;@Reeza mentioned (%macro ... /store source; ) and I could&lt;/P&gt;&lt;P&gt;display it in the log, BUT I could not find a away to copy it into the program editor&lt;/P&gt;&lt;P&gt;in order to edit/update it.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2016 00:52:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/300575#M1199</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-25T00:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Save the program in a SOURCE entry in the SAS catalog</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/330810#M1855</link>
      <description>&lt;P&gt;Catalogs &amp;nbsp;make a handy container for modest volumes.&lt;/P&gt;
&lt;P&gt;As there is a catalog engine for the filename statement, base SAS (which EG, UE and Studio all use to run SAS) can write syntax to a catalog entry.&lt;/P&gt;
&lt;P&gt;I do not have enough experience of Stored Processes or the equivalent forms used by SAS Studio and UE to suggest that route would allow you to create your own process to easily store your own code in a SAS catalog. However, this demo program did work in UE. I included proc catalog code to show the contents of the catalog. &amp;nbsp;The prerequisite: a file in myfolders/ named "thatprog.sas"&lt;/P&gt;
&lt;PRE&gt;filename there '/folders/myfolders' ;&lt;BR /&gt;%let trialcode = thatprog ;&lt;BR /&gt;data _null_ ;&lt;BR /&gt; filename mycat catalog 'work.demo' lrecl= 256 ;&lt;BR /&gt;   file   mycat("&amp;amp;trialcode..source") ;&lt;BR /&gt; infile   there("&amp;amp;trialcode..sas") ;&lt;BR /&gt; input ;&lt;BR /&gt; put _infile_ ;&lt;BR /&gt;run ;&lt;BR /&gt;&lt;BR /&gt;proc catalog c= work.demo ;&lt;BR /&gt;contents ;&lt;BR /&gt;run;&lt;BR /&gt;quit ;&lt;/PRE&gt;
&lt;P&gt;I use the code-library filename approach, expecting the code library to be a common definition, and regularly the only extra definition will be the name for "thatprog"&lt;/P&gt;
&lt;P&gt;Hope it might be helpful...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 12:06:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Save-the-program-in-a-SOURCE-entry-in-the-SAS-catalog/m-p/330810#M1855</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2017-02-08T12:06:02Z</dc:date>
    </item>
  </channel>
</rss>

