<?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: In Jupyter Notebook, how to excute another sas file ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/In-Jupyter-Notebook-how-to-excute-another-sas-file/m-p/616796#M180639</link>
    <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/71754"&gt;@Kalind_Patel&lt;/a&gt; &lt;BR /&gt;Thanks a lot. It worked! Relatedly, could you please also let me know how to run another ipynb code in my MAIN ipynb code file that works with SAS kernel in Jupyter?&lt;BR /&gt;&lt;BR /&gt;It's basically the same situation as I described with the exception that the target code is ipynb (instead of sas) because I'll write down my SAS code in Jupyter.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sun, 12 Jan 2020 15:11:23 GMT</pubDate>
    <dc:creator>braam</dc:creator>
    <dc:date>2020-01-12T15:11:23Z</dc:date>
    <item>
      <title>In Jupyter Notebook, how to excute another sas file ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Jupyter-Notebook-how-to-excute-another-sas-file/m-p/616785#M180634</link>
      <description>&lt;P&gt;Thanks to the SAS blog (&lt;A href="https://blogs.sas.com/content/sasdummy/2016/04/24/how-to-run-sas-programs-in-jupyter-notebook/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2016/04/24/how-to-run-sas-programs-in-jupyter-notebook/&lt;/A&gt;), I'm trying to use SAS in Jupyter Notebook.&amp;nbsp;But I would like to know how I can recall and run another SAS code file in Jupyter Notebook.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Back in my Windows SAS, I always have the below line at the beginning of all my code files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%include ".\1. Research\MacroSetup.sas";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please note that I used a relative path in %include statement, so it starts with "."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to achieve the same thing in Jupyter, but it didn't work. Could anybody please help me with that? Even though I would like to keep using the relative path, it is not necessary. So I replaced it with its full path, but it didn't work.&lt;/P&gt;
&lt;P&gt;In addition, I also replaced "\" with "\\" in Jupyter, but it didn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log I got is here:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;SPAN class="ansi-red-intense-fg ansi-bold"&gt;Error in calling magic 'include' on line:
    [Errno 22] Invalid argument: 'C:\\Dropbox (Personal)\\1. Research\\0 Common sets\\Compustat\\.\x01'
    args: ['.\x01. Research\\MacroSetup.sas ;']
    kwargs: {}
&lt;/SPAN&gt;&lt;SPAN class="ansi-red-intense-fg ansi-bold"&gt;Traceback (most recent call last):
  File "C:\Users\yjaey\Anaconda3\lib\site-packages\metakernel\magic.py", line 94, in call_magic
    func(*args, **kwargs)
  File "C:\Users\yjaey\Anaconda3\lib\site-packages\metakernel\magics\include_magic.py", line 30, in line_include
    text += open(filename).read() + "\n"
OSError: [Errno 22] Invalid argument: 'C:\\Dropbox (Personal)\\1. Research\\0 Common sets\\Compustat\\.\x01'

&lt;/SPAN&gt;&lt;SPAN class="ansi-red-intense-fg ansi-bold"&gt;%include FILENAME ... - include code from filename into this code

This line magic will get the contents of a file and include it
in this cell evaluation.

You can have multiple %include's at the beginning of a cell,
and they will be included in order.

Examples:
    %include myprog.py
    %include myprog1.py myprog2.py&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition to this macro setup, many of my SAS codes are inter-related with %include statement.&amp;nbsp; so, I really would like to figure this out. Many thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jan 2020 14:13:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Jupyter-Notebook-how-to-excute-another-sas-file/m-p/616785#M180634</guid>
      <dc:creator>braam</dc:creator>
      <dc:date>2020-01-12T14:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: In Jupyter Notebook, how to excute another sas file ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Jupyter-Notebook-how-to-excute-another-sas-file/m-p/616795#M180638</link>
      <description>&lt;P&gt;Jupyter is always sensitive for '&lt;STRONG&gt;%&lt;/STRONG&gt;',&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If you need to run a SAS macro as the first statement, then insert a blank line as the first line in the notebook cell and the macro on the second line. The blank line prevents Python from interpreting the macro variable as a magic.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jan 2020 14:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Jupyter-Notebook-how-to-excute-another-sas-file/m-p/616795#M180638</guid>
      <dc:creator>Kalind_Patel</dc:creator>
      <dc:date>2020-01-12T14:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: In Jupyter Notebook, how to excute another sas file ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Jupyter-Notebook-how-to-excute-another-sas-file/m-p/616796#M180639</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/71754"&gt;@Kalind_Patel&lt;/a&gt; &lt;BR /&gt;Thanks a lot. It worked! Relatedly, could you please also let me know how to run another ipynb code in my MAIN ipynb code file that works with SAS kernel in Jupyter?&lt;BR /&gt;&lt;BR /&gt;It's basically the same situation as I described with the exception that the target code is ipynb (instead of sas) because I'll write down my SAS code in Jupyter.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 12 Jan 2020 15:11:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Jupyter-Notebook-how-to-excute-another-sas-file/m-p/616796#M180639</guid>
      <dc:creator>braam</dc:creator>
      <dc:date>2020-01-12T15:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: In Jupyter Notebook, how to excute another sas file ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Jupyter-Notebook-how-to-excute-another-sas-file/m-p/616797#M180640</link>
      <description>&lt;P&gt;I'm not sure what exactly you want to achieve by running another ipynb file,&lt;BR /&gt;but I guess it should be executed like this:&lt;/P&gt;
&lt;PRE class="lang-py prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pun"&gt;%&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;run &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;./another_file&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;ipynb
foo&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;()&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jan 2020 15:18:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Jupyter-Notebook-how-to-excute-another-sas-file/m-p/616797#M180640</guid>
      <dc:creator>Kalind_Patel</dc:creator>
      <dc:date>2020-01-12T15:18:12Z</dc:date>
    </item>
  </channel>
</rss>

