<?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 %include sas program in the same folder in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204197#M38010</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently I have my include statements as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%include "M:\Program\Macros\one.sas";&lt;/P&gt;&lt;P&gt;%include "M:\Program\Macros\Macros\two.sas";&lt;/P&gt;&lt;P&gt;%include "M:\Program\Macros\Macros\three.sas";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program that has these two lines are code is located in "M:\Program."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to write these three lines where I do not have to include "M:\Program" and SAS will look in the same folder for example "Macros\one.sas?"&amp;nbsp; I would like this program to run regardless of the Program folder location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried %include "Macros\one.sas"; but that doesn't seem to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jul 2015 19:21:43 GMT</pubDate>
    <dc:creator>dtchoi86</dc:creator>
    <dc:date>2015-07-15T19:21:43Z</dc:date>
    <item>
      <title>%include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204197#M38010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently I have my include statements as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%include "M:\Program\Macros\one.sas";&lt;/P&gt;&lt;P&gt;%include "M:\Program\Macros\Macros\two.sas";&lt;/P&gt;&lt;P&gt;%include "M:\Program\Macros\Macros\three.sas";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program that has these two lines are code is located in "M:\Program."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to write these three lines where I do not have to include "M:\Program" and SAS will look in the same folder for example "Macros\one.sas?"&amp;nbsp; I would like this program to run regardless of the Program folder location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried %include "Macros\one.sas"; but that doesn't seem to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 19:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204197#M38010</guid>
      <dc:creator>dtchoi86</dc:creator>
      <dc:date>2015-07-15T19:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204198#M38011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I kind of wonder what the problem is with three lines of code?&lt;/P&gt;&lt;P&gt;One approach could be to put those three lines in one program file and then only include that program in the (presumed) main program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another approach would be to establish an AUTOCALL macro library and then have the SAS startup add that location.&lt;/P&gt;&lt;P&gt;(Assumes those files are basically macro definitions only).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 19:32:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204198#M38011</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-07-15T19:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204199#M38012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In what environment are you running the program (e.g. Display Manager SAS interactive, batch, Enterprise Guide, etc?)&amp;nbsp; Different environments have different ways of dynamically finding the location of the "current" program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes instead of dynamically figuring it out, it's easiest to just create a global macro session variable with the root path for the project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if you had (slightly different structure):&lt;/P&gt;&lt;P&gt;M:\Project1\Program\main.sas&lt;/P&gt;&lt;P&gt;M:\Project1\Pogram\one.sas&lt;/P&gt;&lt;P&gt;M:\Project1\Program\Macros\macro1.sas&lt;/P&gt;&lt;P&gt;M:\Project1\Program\Macros\macro2.sas&lt;/P&gt;&lt;P&gt;M:\Project1\Output\&lt;/P&gt;&lt;P&gt;M:\Project1\Data&lt;/P&gt;&lt;P&gt;M:\Project2\Program\main.sas&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In main.sas, you could %let root=M:\Project1.&amp;nbsp; It calls all the other programs as needed.&amp;nbsp; Once you know &amp;amp;root, you know code is in &amp;amp;root\Program, macros are in &amp;amp;root\Program\macros, output goes to &amp;amp;root\Output, etc etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also checkout the macro autocall facility.&amp;nbsp; It takes only a small amount of setup, but has benefits of %including macros.&amp;nbsp; (That said, I %included macros for years....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 19:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204199#M38012</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-07-15T19:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204200#M38013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I apologize for the confusion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is another program entitled "main.sas" in folder "M:\Program."&amp;nbsp; Main.sas has the following lines of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%include "M:\Program\Macros\one.sas";&lt;/P&gt;&lt;P&gt;%include "M:\Program\Macros\Macros\two.sas";&lt;/P&gt;&lt;P&gt;%include "M:\Program\Macros\Macros\three.sas";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering if I can make main.sas a bit smart where I do not have to include "M:\Program."&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 19:37:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204200#M38013</guid>
      <dc:creator>dtchoi86</dc:creator>
      <dc:date>2015-07-15T19:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204201#M38014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ultimately, I would like to run this in a batch in windows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to share this program with other users.&amp;nbsp; If they were to unpackaged this to their desktop, I don't think this approach would work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 19:40:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204201#M38014</guid>
      <dc:creator>dtchoi86</dc:creator>
      <dc:date>2015-07-15T19:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204202#M38015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For PC SAS interactive and batch, I use a macro like:&lt;/P&gt;&lt;PRE&gt;%macro ProgramName
&amp;nbsp; (path=0 /*Boolean, include path or not*/
&amp;nbsp; )
;

%local return; 

%*SYSIN only exists in batch, SAS_EXECFILENAME only exists in interactive;

%*When batch submit;
%let return = %qsysfunc(getOption(SYSIN)); 
%if %superq(return) ne %str() %then %do;
&amp;nbsp; %if &amp;amp;path ne 1 %then %let return = %qscan(&amp;amp;return,-1,\/);
%end;

%*When DMS interactive;
%if %superq(return)=%str() %then %do;
&amp;nbsp; %if &amp;amp;path=1 %then %let return = %qsysfunc(sysget(SAS_EXECFILEPATH));
&amp;nbsp; %else %let return = %qsysfunc(sysget(SAS_EXECFILENAME));
%end;

&amp;amp;return
%mend;
&lt;/PRE&gt;&lt;P&gt;To return program name with path, call like %put %programname(path=1) ;&amp;nbsp;&amp;nbsp;&amp;nbsp; Something like that could be useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 20:01:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204202#M38015</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-07-15T20:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204203#M38016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here are a couple of pages with information about your big topic: setting up for running in batch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Batch_processing_under_Windows" title="http://www.sascommunity.org/wiki/Batch_processing_under_Windows"&gt;http://www.sascommunity.org/wiki/Batch_processing_under_Windows&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My own naming conventions for folders differ from yours&lt;/P&gt;&lt;P&gt;I have a SAS-Projects folder&lt;/P&gt;&lt;P&gt;under which are projects, such as Project-A, Project-B, Project-Z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one of the 'project' folders is named SAS-site, which is my tool-box;&lt;/P&gt;&lt;P&gt;and it has a sub-folder named 'macros'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your Q comes up in every class I have taught about macro usage:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"How can I get SAS to find (i.e. search for) my macros?"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thus the by-guess-and-by-golly solution that you have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%include '...\MyMacroA.sas';&lt;/P&gt;&lt;P&gt;%include '...\MyMacroB.sas';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the key issues are explained on this page&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/SASautos_Companion_Reusing_Macros" title="http://www.sascommunity.org/wiki/SASautos_Companion_Reusing_Macros"&gt;SASautos Companion Reusing Macros - sasCommunity&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the option SASAUTOS contains the search path (i.e. library, a set of folders)&lt;/P&gt;&lt;P&gt;for the autocall (auto-search) macro facility.&lt;/P&gt;&lt;P&gt;The default value is the fileref sasautos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use these statement in your autoexec.sas&lt;/P&gt;&lt;P&gt;to add folders to the autocall search list&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename project '.'; *here: project folder;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename sitemacr '&amp;lt;???&amp;gt;';*there: tool-box containing macros in files;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kw4"&gt;options&lt;/SPAN&gt; mautosource&lt;/P&gt;&lt;P&gt;&amp;nbsp; sasautos = &lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;Project SiteMacr SASautos&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you have the macro autocall facility working for you;&lt;/P&gt;&lt;P&gt;no need to %include your macros.&lt;/P&gt;&lt;P&gt;SAS searches those folders, finds a file with the name of the macro, %includes it,&lt;/P&gt;&lt;P&gt;and the compiled code is saved in catalog work.sasmacro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... and see the location of the macro with this option&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; options mautocomploc;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 20:07:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204203#M38016</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2015-07-15T20:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204204#M38017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow this is quite a bit of great information.&amp;nbsp; Thank you for all your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 20:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204204#M38017</guid>
      <dc:creator>dtchoi86</dc:creator>
      <dc:date>2015-07-15T20:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204205#M38018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I find it a lot easier just to do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let MyProgramFolder = M:\Program;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%include "&amp;amp;MyProgramFolder\Macros\one.sas";&lt;/P&gt;&lt;P&gt;%include "&amp;amp;MyProgramFolder\Macros\Macros\two.sas";&lt;/P&gt;&lt;P&gt;%include "&amp;amp;MyProgramFolder\Macros\Macros\three.sas";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I think using AUTOCALL macros as already discussed is a better approach.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 20:12:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204205#M38018</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2015-07-15T20:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204206#M38019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SAS AUTOCALL method also permits externalized SASAUTOS environment (concatenation, various OS platform environments considered) change for testing, albeit without making any SAS program code change.&amp;nbsp; The alternative would be to edit the SAS program directly and change the %LET statement that identifies the SAS program source code reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott Barry&lt;/P&gt;&lt;P&gt;SBBWorks, Inc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 20:51:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204206#M38019</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2015-07-15T20:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204207#M38020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The autocall is for sas-macros not for sas-code. &lt;BR /&gt;What you could do is allocating a filename. You can use concatenated locations for that. It a PDS approach sbb will recognize.&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp; Filename mycode&amp;nbsp; "M:\Program\Macros" ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than you still can decide to use the fileref&amp;nbsp; "mycode" to be used in a sasautos approach for sas-macro-s or use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %include nycode(main) ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming mian.sas (default suffix .sas) is your code to be included. When developing working with macro-s also very handy to recompile those.&lt;/P&gt;&lt;P&gt;With a different sufffix&amp;nbsp; enclose the name in quites like "main.sasold"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 21:30:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204207#M38020</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-07-15T21:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204208#M38021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the correction, Jaap -- agreed that SASAUTOS has limited applicability here.&amp;nbsp; I stand corrected.&lt;/P&gt;&lt;P&gt;Scott Barry&lt;/P&gt;&lt;P&gt;SBBWorks, Inc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2015 08:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204208#M38021</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2015-07-16T08:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204209#M38022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to add, if you only plan on running in Batch then (think its one dot, been a while since I have used it):&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%include ".\Macros\one.sas";&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%include ".\Macros\Macros\two.sas";&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%include ".\Macros\Macros\three.sas";&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Then SAS starts with the path of the program you are running and expands the . for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2015 09:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204209#M38022</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-07-16T09:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204210#M38023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. You can you can run PIPE at your SAS.&lt;/P&gt;&lt;P&gt;Add the following code into Main.sas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename x pipe 'dir&amp;nbsp; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;M:\Program\*.sas &lt;/SPAN&gt; /s /b';&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;infile x length=len;&lt;/P&gt;&lt;P&gt;input x $varying200. len;&lt;/P&gt;&lt;P&gt;call execute( cats('&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%include "&lt;/SPAN&gt; ' , x ,' &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;"; &lt;/SPAN&gt;') );&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;PRE&gt;&lt;/PRE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2015 13:42:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204210#M38023</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-07-16T13:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204211#M38024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for the very helpful input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked; thank you so much RW9. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2015 14:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204211#M38024</guid>
      <dc:creator>dtchoi86</dc:creator>
      <dc:date>2015-07-16T14:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: %include sas program in the same folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204212#M38025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not completely true.&amp;nbsp; If you use a relative path, such as "./macros", the base of the path will be the current SAS folder.&amp;nbsp; In batch, that is *usually* the folder containing the program, but not always - it depends on how you started the program and whether you site has changed or added to any of the default system options, configuration files, and autoexec files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the SAS for Windows Display Manager, the active directory is shown in the lower right hand corner.&amp;nbsp; For me , it's usually my user directory, but again it depends on how I started SAS and what options, configurations, and autoexecs are in effect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 13:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-sas-program-in-the-same-folder/m-p/204212#M38025</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2015-07-20T13:44:35Z</dc:date>
    </item>
  </channel>
</rss>

