<?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 Integrating Python code in SAS DI Studio Job in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Integrating-Python-code-in-SAS-DI-Studio-Job/m-p/507111#M15736</link>
    <description>&lt;P&gt;I am building a SAS DI-studio job to update an analytical base table, as well as draw sample data for building&amp;nbsp;predictive models. As part of the flow, I want to run some python code to do a an SGD classifier based on a term frequency–inverse document frequency of some words. The result of this classifier will be a list of words and weights that will produce features to be used in a SAS miner model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I can tell, I have the following options:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;re-write the python program in SAS code (which I fear will be a non-trivial task, possibly requirering lisences we dont have, such as proc IML and/or SAS text miner), then apply this as a user written transformation or user written code&lt;/LI&gt;&lt;LI&gt;simply run the program manually, and import the results before doing the analysis in SAS MINER&lt;/LI&gt;&lt;LI&gt;use user-written code\user made transformation to run an x command to execute the python code&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Run everything through python instead, using SASpy to execute the SAS code&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Are there more options? What would you reccomend?&lt;/P&gt;</description>
    <pubDate>Wed, 24 Oct 2018 11:41:34 GMT</pubDate>
    <dc:creator>Ullsokk</dc:creator>
    <dc:date>2018-10-24T11:41:34Z</dc:date>
    <item>
      <title>Integrating Python code in SAS DI Studio Job</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integrating-Python-code-in-SAS-DI-Studio-Job/m-p/507111#M15736</link>
      <description>&lt;P&gt;I am building a SAS DI-studio job to update an analytical base table, as well as draw sample data for building&amp;nbsp;predictive models. As part of the flow, I want to run some python code to do a an SGD classifier based on a term frequency–inverse document frequency of some words. The result of this classifier will be a list of words and weights that will produce features to be used in a SAS miner model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I can tell, I have the following options:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;re-write the python program in SAS code (which I fear will be a non-trivial task, possibly requirering lisences we dont have, such as proc IML and/or SAS text miner), then apply this as a user written transformation or user written code&lt;/LI&gt;&lt;LI&gt;simply run the program manually, and import the results before doing the analysis in SAS MINER&lt;/LI&gt;&lt;LI&gt;use user-written code\user made transformation to run an x command to execute the python code&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Run everything through python instead, using SASpy to execute the SAS code&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Are there more options? What would you reccomend?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 11:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integrating-Python-code-in-SAS-DI-Studio-Job/m-p/507111#M15736</guid>
      <dc:creator>Ullsokk</dc:creator>
      <dc:date>2018-10-24T11:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Integrating Python code in SAS DI Studio Job</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integrating-Python-code-in-SAS-DI-Studio-Job/m-p/507121#M15737</link>
      <description>&lt;P&gt;I don't have any hands on experience of this, just giving my architectural PoV.&lt;/P&gt;
&lt;P&gt;If this Python stuff can be seen as part of ETL, I'm pro of having that logic inside DIS.&lt;/P&gt;
&lt;P&gt;I don't know which is the best method, but there seem to be an option to call Python from a data step Java object. See the link for details.&lt;/P&gt;
&lt;P&gt;Perhaps you could create a custom transformation to package this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/sassoftware/enlighten-integration" target="_blank"&gt;https://github.com/sassoftware/enlighten-integration&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 13:03:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integrating-Python-code-in-SAS-DI-Studio-Job/m-p/507121#M15737</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-10-24T13:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Integrating Python code in SAS DI Studio Job</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integrating-Python-code-in-SAS-DI-Studio-Job/m-p/507160#M15738</link>
      <description>It is stricktly speaking not part of the daily ETL. But every six months or so, some 20 models will be updated with new data, which requires the python job to run. But will check out the link, thanks!</description>
      <pubDate>Wed, 24 Oct 2018 14:18:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integrating-Python-code-in-SAS-DI-Studio-Job/m-p/507160#M15738</guid>
      <dc:creator>Ullsokk</dc:creator>
      <dc:date>2018-10-24T14:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Integrating Python code in SAS DI Studio Job</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integrating-Python-code-in-SAS-DI-Studio-Job/m-p/507450#M15740</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've certainly done this in the past using the xcmd route.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially you're treating the script as any other OS command. Just need to make sure that the account you run your SAS batch processes as is properly setup to execute the python, e.g. has python in it's path, has permissions to run it, and whatever rights it needs to any files/directories.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Top tip - get the python (or bash, cmd, powershell or whatever) script to echo something to standard out when it finished, like some success or fail or whatever text/messages, and use a pipe to read that, so that your SAS process knows that it's worked, or not.&amp;nbsp;You can't always rely on return codes, or the fact that the thing you called actually ran, to know if it worked or not. Experience with flaky Windows servers has lead me to always try to do this.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 11:04:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integrating-Python-code-in-SAS-DI-Studio-Job/m-p/507450#M15740</guid>
      <dc:creator>AngusLooney</dc:creator>
      <dc:date>2018-10-25T11:04:58Z</dc:date>
    </item>
  </channel>
</rss>

