<?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: Invoke SAS Code through %Include Remotely in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Invoke-SAS-Code-through-Include-Remotely/m-p/402051#M278780</link>
    <description>&lt;P&gt;Do I correctly rephrase your question as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"I have code in an external .sas file and want that rsubmitted."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, there is no straightforward syntax to do that that I know of. (Would be nice if there was, though). Can't you add the rsubmit/endrsubmit pair to the file you %include? Otherwise, how about running a datastep that reads your SAS code into a temp file with rsubmit/endrsubmit added and then %include that temp file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Untested:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename runme temp;
filename source '...';
data _null_;
   infile source end=eof; 
   put runme;
   if _n_=1 then put ' rsubmit';
   input;
   put _infile_;
   if (eof) then put 'endrsubmit;';
run;
%include runme;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
    <pubDate>Sat, 07 Oct 2017 09:14:23 GMT</pubDate>
    <dc:creator>jklaverstijn</dc:creator>
    <dc:date>2017-10-07T09:14:23Z</dc:date>
    <item>
      <title>Invoke SAS Code through %Include Remotely</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invoke-SAS-Code-through-Include-Remotely/m-p/401677#M278776</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to run sas code between RSUBMIT AND ENDRSUBMIT.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below 3 lines of code I will submit, it will call another program which is again stored in server itself. so I need to put that in between rsubmit and endrsubmit again. However I am getting error when I submit this as,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ERROR: Invalid or unspecified remote session ID. Set OPTIONS REMOTE=session_id. Please help me to overcome this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOte: This is just a sample code, I have different programs in which I need to include multiple programs where those programs have lengthy of code between multiple rsubmit and endrsubmit statements.&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;rsubmit&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%include&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'/users/Startupcode.sas'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;endrsubmit&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;U&gt;&lt;STRONG&gt;Startupcode.sas:&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;BR /&gt;data pathchk;&lt;BR /&gt;infile '/users/configfile.txt' dlm='$$$$$$$$$';&lt;BR /&gt;input var1 :$150.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;endrsubmit;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 10:11:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invoke-SAS-Code-through-Include-Remotely/m-p/401677#M278776</guid>
      <dc:creator>Hari2</dc:creator>
      <dc:date>2017-10-06T10:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Invoke SAS Code through %Include Remotely</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invoke-SAS-Code-through-Include-Remotely/m-p/401683#M278777</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127753"&gt;@Hari2&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you rsubmit an rsubmit statement than that second rsubmit gets executed on the remote server. And thus it will only work if that remote server is itself also connected to a SAS/Connect session via signon. The message you see indicates that is not the case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would need more detail on what needs to run where in order to help you figure out the proper way of doing things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 10:19:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invoke-SAS-Code-through-Include-Remotely/m-p/401683#M278777</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2017-10-06T10:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Invoke SAS Code through %Include Remotely</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invoke-SAS-Code-through-Include-Remotely/m-p/401685#M278778</link>
      <description>&lt;P&gt;Hi Jan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;basically, I need to call a program from another program through #include method and both the programs should be submitted to server. And, all programs are saved in server location.&lt;/P&gt;&lt;P&gt;So here, when I submit Program 1, it is running fine. and to invoke&amp;nbsp;2nd program through #include method , since it is saved in server path , I need to put #include statement b/n rsub and endrsub. but the 2nd program, again has sas code between rsubmit and endrsubmit statemnts. So here the issue is coming.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Hari.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 10:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invoke-SAS-Code-through-Include-Remotely/m-p/401685#M278778</guid>
      <dc:creator>Hari2</dc:creator>
      <dc:date>2017-10-06T10:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Invoke SAS Code through %Include Remotely</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invoke-SAS-Code-through-Include-Remotely/m-p/401690#M278779</link>
      <description>&lt;P&gt;Code between rsubmit and endrsubmit needs a connection to another SAS/CONNECT session. If that is not there, it won't work, period. Either set up that required session on the server-side session before the %include, or delete the rsubmit/endrsubmit from the include.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 10:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invoke-SAS-Code-through-Include-Remotely/m-p/401690#M278779</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-06T10:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Invoke SAS Code through %Include Remotely</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invoke-SAS-Code-through-Include-Remotely/m-p/402051#M278780</link>
      <description>&lt;P&gt;Do I correctly rephrase your question as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"I have code in an external .sas file and want that rsubmitted."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, there is no straightforward syntax to do that that I know of. (Would be nice if there was, though). Can't you add the rsubmit/endrsubmit pair to the file you %include? Otherwise, how about running a datastep that reads your SAS code into a temp file with rsubmit/endrsubmit added and then %include that temp file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Untested:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename runme temp;
filename source '...';
data _null_;
   infile source end=eof; 
   put runme;
   if _n_=1 then put ' rsubmit';
   input;
   put _infile_;
   if (eof) then put 'endrsubmit;';
run;
%include runme;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2017 09:14:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invoke-SAS-Code-through-Include-Remotely/m-p/402051#M278780</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2017-10-07T09:14:23Z</dc:date>
    </item>
  </channel>
</rss>

