<?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: What's the best way to automate tasks in SAS Studio? in Developers</title>
    <link>https://communities.sas.com/t5/Developers/What-s-the-best-way-to-automate-tasks-in-SAS-Studio/m-p/877746#M6374</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/101232"&gt;@a20121248&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can also take a look at some of&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10923"&gt;@Mike_Drutar&lt;/a&gt;'s Community articles on Job Execution. For example,&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Executing-a-JES-Job-Using-JavaScript/ta-p/626489" target="_self"&gt;Executing a JES Job Using JavaScript&lt;/A&gt;. He has several others posted and they're super easy to follow.&lt;/P&gt;</description>
    <pubDate>Fri, 26 May 2023 17:48:17 GMT</pubDate>
    <dc:creator>joeFurbee</dc:creator>
    <dc:date>2023-05-26T17:48:17Z</dc:date>
    <item>
      <title>What's the best way to automate tasks in SAS Studio?</title>
      <link>https://communities.sas.com/t5/Developers/What-s-the-best-way-to-automate-tasks-in-SAS-Studio/m-p/877527#M6369</link>
      <description>&lt;P&gt;Hi experts:&lt;/P&gt;
&lt;P&gt;I have Viya 3.5. I need a way to orchestrate these tasks:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;pull from a Git remote repo&lt;/LI&gt;
&lt;LI&gt;create a Job definition&lt;/LI&gt;
&lt;LI&gt;execute the Job&lt;/LI&gt;
&lt;LI&gt;publish a registered model in Model Manager&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;My approach was to consume the SAS Rest API (&lt;A style="background-color: #ffffff;" href="https://developer.sas.com/guides/rest.html" target="_blank" rel="noopener"&gt;https://developer.sas.com/guides/rest.html&lt;/A&gt;), though I'm not sure if the right approach because I have to format "proc http response" from SAS Studio, for example:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="a20121248_0-1685027102335.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84321i4864A46628B01758/image-size/medium?v=v2&amp;amp;px=400" role="button" title="a20121248_0-1685027102335.png" alt="a20121248_0-1685027102335.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MicrosoftTeams-image (16).png" style="width: 341px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84324i0875112A6CD3FD78/image-dimensions/341x256?v=v2" width="341" height="256" role="button" title="MicrosoftTeams-image (16).png" alt="MicrosoftTeams-image (16).png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I want to ask 2 questions:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Is it possible to get the access_token from my SAS Studio Logged session? or is it possible to call SAS Rest API from SAS Studio since I'm already authenticated (bypass access_token parameter)?&lt;/LI&gt;
&lt;LI&gt;Is there another way to create Jobs, Publish Models from code without using API?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;I am open to all suggestions. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 19:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/What-s-the-best-way-to-automate-tasks-in-SAS-Studio/m-p/877527#M6369</guid>
      <dc:creator>a20121248</dc:creator>
      <dc:date>2023-05-25T19:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: What's the best way to automate tasks in SAS Studio?</title>
      <link>https://communities.sas.com/t5/Developers/What-s-the-best-way-to-automate-tasks-in-SAS-Studio/m-p/877573#M6370</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/101232"&gt;@a20121248&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Talk to the folks at &lt;A href="https://sasjs.io/" target="_self"&gt;SASJs.io&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;They have a macro for that &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; (getting App Token, that is)&lt;/P&gt;
&lt;P&gt;In terms Orchestration/Automation within SAS Studio, it all depends on which version of Viya/SAS Studio you are using!&lt;/P&gt;
&lt;P&gt;There are various versions of SAS Studio and they vary in their features and functionalities.&lt;/P&gt;
&lt;P&gt;&lt;A title="What are the release dates for SAS Studio?" href="https://support.sas.com/software/products/sas-studio/faq/SASStudio_releases.htm" target="_self"&gt;https://support.sas.com/software/products/sas-studio/faq/SASStudio_releases.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="What new features are available in SAS Studio?" href="https://support.sas.com/software/products/sas-studio/faq/whatsnew.htm" target="_self"&gt;https://support.sas.com/software/products/sas-studio/faq/whatsnew.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 18:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/What-s-the-best-way-to-automate-tasks-in-SAS-Studio/m-p/877573#M6370</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-05-25T18:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: What's the best way to automate tasks in SAS Studio?</title>
      <link>https://communities.sas.com/t5/Developers/What-s-the-best-way-to-automate-tasks-in-SAS-Studio/m-p/877574#M6371</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/28909"&gt;@AllanBowe&lt;/a&gt;&lt;BR /&gt;Do you have bandwidth to chime in?</description>
      <pubDate>Thu, 25 May 2023 18:21:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/What-s-the-best-way-to-automate-tasks-in-SAS-Studio/m-p/877574#M6371</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-05-25T18:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: What's the best way to automate tasks in SAS Studio?</title>
      <link>https://communities.sas.com/t5/Developers/What-s-the-best-way-to-automate-tasks-in-SAS-Studio/m-p/877576#M6372</link>
      <description>&lt;P&gt;Personally, I wouldn't do this in Studio, I'd write a shell script instead&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;```&lt;/P&gt;
&lt;P&gt;# first, set up the authentication using sasjs auth with client/secret pair&lt;/P&gt;
&lt;P&gt;cd myrepo # move into project&lt;/P&gt;
&lt;P&gt;git pull # grab source code&lt;/P&gt;
&lt;P&gt;sasjs cbd # compile, build &amp;amp; deploy my job(s)&lt;/P&gt;
&lt;P&gt;sasjs job execute /path/to/my/job -l /local/path/to/my.log&amp;nbsp;&lt;/P&gt;
&lt;P&gt;```&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you must use SAS code, in Studio (Viya) you don't actually need an access token as you can use the oauthbearer=sas_services proc http option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case you can use the git_clone and git_pull SAS functions to clone the repo.&lt;/P&gt;
&lt;P&gt;Then, this macro to create the job(s):&amp;nbsp;&amp;nbsp;&lt;A href="https://core.sasjs.io/mv__createjob_8sas.html" target="_blank"&gt;https://core.sasjs.io/mv__createjob_8sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And this macro to run them:&amp;nbsp; &lt;A href="https://core.sasjs.io/mv__jobflow_8sas.html" target="_blank"&gt;https://core.sasjs.io/mv__jobflow_8sas.html&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We don't work much with Model Manager (our main focus is cross-platform SAS apps and related modernisations) but available to support if needed.&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 18:39:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/What-s-the-best-way-to-automate-tasks-in-SAS-Studio/m-p/877576#M6372</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2023-05-25T18:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: What's the best way to automate tasks in SAS Studio?</title>
      <link>https://communities.sas.com/t5/Developers/What-s-the-best-way-to-automate-tasks-in-SAS-Studio/m-p/877746#M6374</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/101232"&gt;@a20121248&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can also take a look at some of&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10923"&gt;@Mike_Drutar&lt;/a&gt;'s Community articles on Job Execution. For example,&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Executing-a-JES-Job-Using-JavaScript/ta-p/626489" target="_self"&gt;Executing a JES Job Using JavaScript&lt;/A&gt;. He has several others posted and they're super easy to follow.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 17:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/What-s-the-best-way-to-automate-tasks-in-SAS-Studio/m-p/877746#M6374</guid>
      <dc:creator>joeFurbee</dc:creator>
      <dc:date>2023-05-26T17:48:17Z</dc:date>
    </item>
  </channel>
</rss>

