<?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: Executing python code from SAS Environment in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769650#M244063</link>
    <description>Define execute? &lt;BR /&gt;Is it an entirely separate process or are you expecting Python to use SAS data sets and such? If it's the latter look into SASpy &lt;BR /&gt;If it's the former, look into CALL SYSTEM where you can execute system tasks via SAS. You basically find the command line equivalent (Unix) to execute your Python Script and then ask SAS to execute that command as needed. &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 22 Sep 2021 18:52:28 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-09-22T18:52:28Z</dc:date>
    <item>
      <title>Executing python code from SAS Environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769649#M244062</link>
      <description>&lt;P&gt;Hello Friends -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to execute python code from SAS Environment (Base SAS and SAS EG ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are all the steps we need to follow or enable any settings or any config changes in SAS inorder to run the python code ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We are using SAS 9.4 M7 on Redhat linux ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 18:49:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769649#M244062</guid>
      <dc:creator>sasprofile</dc:creator>
      <dc:date>2021-09-22T18:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Executing python code from SAS Environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769650#M244063</link>
      <description>Define execute? &lt;BR /&gt;Is it an entirely separate process or are you expecting Python to use SAS data sets and such? If it's the latter look into SASpy &lt;BR /&gt;If it's the former, look into CALL SYSTEM where you can execute system tasks via SAS. You basically find the command line equivalent (Unix) to execute your Python Script and then ask SAS to execute that command as needed. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Sep 2021 18:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769650#M244063</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-22T18:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Executing python code from SAS Environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769652#M244064</link>
      <description>Am looking into to execute Python code within SAS Environment ?</description>
      <pubDate>Wed, 22 Sep 2021 19:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769652#M244064</guid>
      <dc:creator>sasprofile</dc:creator>
      <dc:date>2021-09-22T19:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Executing python code from SAS Environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769654#M244065</link>
      <description>Can you please provide more details.</description>
      <pubDate>Wed, 22 Sep 2021 19:04:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769654#M244065</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-22T19:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Executing python code from SAS Environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769658#M244068</link>
      <description>&lt;P&gt;SAS recently &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_017/proc/p0sj9pq2ryjlphn1ceq7ntpc1ipp.htm" target="_self"&gt;introduced PROC PYTHON&lt;/A&gt; -- but it's only in SAS Viya, not in SAS 9.4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can include &lt;A href="https://blogs.sas.com/content/sgf/2019/06/04/using-python-functions-inside-sas-programs/" target="_self"&gt;Python code within custom functions using PROC FCMP,&lt;/A&gt;&amp;nbsp;and that works in SAS 9.4 Maint 7.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you can run Python scripts by kicking off &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostunx/p0lzxl2mwndagun1dtxbst9s4jea.htm" target="_self"&gt;an external process via SYSTASK or another mechanism&lt;/A&gt; to call out to the shell, if that's something you're allowed to do.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 19:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769658#M244068</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2021-09-22T19:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Executing python code from SAS Environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769684#M244069</link>
      <description>Sorry I didnt get you, what details you need ?</description>
      <pubDate>Wed, 22 Sep 2021 19:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769684#M244069</guid>
      <dc:creator>sasprofile</dc:creator>
      <dc:date>2021-09-22T19:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Executing python code from SAS Environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769687#M244070</link>
      <description>Thank you Chris&lt;BR /&gt;Do I need to enable any settings for this python code to run from SAS Enterprise Guide ?</description>
      <pubDate>Wed, 22 Sep 2021 19:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769687#M244070</guid>
      <dc:creator>sasprofile</dc:creator>
      <dc:date>2021-09-22T19:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Executing python code from SAS Environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769692#M244072</link>
      <description>&lt;P&gt;A Python runtime (of course) and some environment variables are needed to set it up. &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lecompobjref/p18qp136f91aaqn1h54v3b6pkant.htm" target="_self"&gt;See the documentation for the FCMP Python object&amp;nbsp;&lt;/A&gt; and &lt;A href="https://go.documentation.sas.com/doc/en/bicdc/9.4/biasag/n1mquxnfmfu83en1if8icqmx8cdf.htm" target="_self"&gt;these config instructions&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Set these at SAS startup (usually a SAS admin task)&amp;nbsp;&lt;STRONG&gt;or&lt;/STRONG&gt; you &lt;EM&gt;might&lt;/EM&gt; be able to use the OPTIONS statement in code right from EG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Examples of setting these (your paths may be different):&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;options set=MAS_M2PATH="/install/SASServer/SASHome/SASFoundation/9.4/misc/tkmas/mas2py.py"
options set=MAS_PYPATH="/usr/bin/python";&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 19:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769692#M244072</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2021-09-22T19:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Executing python code from SAS Environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769693#M244073</link>
      <description>Well Python code can be anything from a Flask app to base python to panda's code. &lt;BR /&gt;&lt;BR /&gt;So details would be like what type of python code and libraries you want to use, and what type of code you plan to run. If it's a process to take a CSV file and do something that Python can do but SAS can't then that's probably easy enough. If you want to run a flask app, I'm seeing possible issues. If you're planning to interface with SAS data somehow I'm also seeing issues.</description>
      <pubDate>Wed, 22 Sep 2021 19:38:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-python-code-from-SAS-Environment/m-p/769693#M244073</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-22T19:38:13Z</dc:date>
    </item>
  </channel>
</rss>

