<?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: sas viya jsf scheduled jobs and flows in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/756863#M1031</link>
    <description>&lt;P&gt;thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78975"&gt;@gwootton&lt;/a&gt;&amp;nbsp; , i will explore on it . but i didn't use job definition ,i checked it is more like a stored process .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;below are my use case which hope you can provide me some ideas how to refresh the latest changes into the "deployed" jobs&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; job created in jsf and pointing to a code (abc.sas) in one of project folder under sas content tree&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elisehoo1_1-1627361497238.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61712i5691573DC0E742A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elisehoo1_1-1627361497238.png" alt="elisehoo1_1-1627361497238.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elisehoo1_0-1627360422325.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61711i8064D8109D1EEBE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elisehoo1_0-1627360422325.png" alt="elisehoo1_0-1627360422325.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. added the job into a flow&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elisehoo1_2-1627361777574.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61713i59E8A9951A5C3272/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elisehoo1_2-1627361777574.png" alt="elisehoo1_2-1627361777574.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. if i change the code (abc.sas) , how do i reflect the change to the "deployed" job which i have embedded in the job flow itself?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. if i can trace the job path/file.sas on those jobs that i seen from flows ?&amp;nbsp;&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;</description>
    <pubDate>Tue, 27 Jul 2021 04:57:45 GMT</pubDate>
    <dc:creator>elisehoo1</dc:creator>
    <dc:date>2021-07-27T04:57:45Z</dc:date>
    <item>
      <title>sas viya jsf scheduled jobs and flows</title>
      <link>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/756494#M1029</link>
      <description>&lt;PRE&gt;hi there, &lt;BR /&gt; for the jobs that i have scheduled, is it a way to show what was the code inside ? does it have any job code for refer back?&lt;BR /&gt;thanks&lt;BR /&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elisehoo1_0-1627216010145.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61679i5E74E7167E89B086/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elisehoo1_0-1627216010145.png" alt="elisehoo1_0-1627216010145.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jul 2021 12:28:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/756494#M1029</guid>
      <dc:creator>elisehoo1</dc:creator>
      <dc:date>2021-07-25T12:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: sas viya jsf scheduled jobs and flows</title>
      <link>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/756628#M1030</link>
      <description>If the job definition is saved to a path in the content server you could go the URL /SASJobExecution and locate the job definition, right-click and select View -&amp;gt; Source Code.&lt;BR /&gt;&lt;BR /&gt;If not, you could access the endpoint for the job definition itself (/jobDefinitions/definition/&amp;lt;id&amp;gt;) and one of the fields returned is the code.</description>
      <pubDate>Mon, 26 Jul 2021 13:36:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/756628#M1030</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2021-07-26T13:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: sas viya jsf scheduled jobs and flows</title>
      <link>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/756863#M1031</link>
      <description>&lt;P&gt;thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78975"&gt;@gwootton&lt;/a&gt;&amp;nbsp; , i will explore on it . but i didn't use job definition ,i checked it is more like a stored process .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;below are my use case which hope you can provide me some ideas how to refresh the latest changes into the "deployed" jobs&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; job created in jsf and pointing to a code (abc.sas) in one of project folder under sas content tree&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elisehoo1_1-1627361497238.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61712i5691573DC0E742A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elisehoo1_1-1627361497238.png" alt="elisehoo1_1-1627361497238.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elisehoo1_0-1627360422325.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61711i8064D8109D1EEBE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elisehoo1_0-1627360422325.png" alt="elisehoo1_0-1627360422325.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. added the job into a flow&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elisehoo1_2-1627361777574.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61713i59E8A9951A5C3272/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elisehoo1_2-1627361777574.png" alt="elisehoo1_2-1627361777574.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. if i change the code (abc.sas) , how do i reflect the change to the "deployed" job which i have embedded in the job flow itself?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. if i can trace the job path/file.sas on those jobs that i seen from flows ?&amp;nbsp;&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;</description>
      <pubDate>Tue, 27 Jul 2021 04:57:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/756863#M1031</guid>
      <dc:creator>elisehoo1</dc:creator>
      <dc:date>2021-07-27T04:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: sas viya jsf scheduled jobs and flows</title>
      <link>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/757125#M1033</link>
      <description>&lt;P&gt;When you create a new job from a saved program, the code of the program is copied into the job request. You can see that code by pulling /jobExecution/jobRequests/&amp;lt;id&amp;gt; (the ID is found in the "general" tab of the job properties) in the "code" attribute. This means any changes to the source code (abc.sas) would not carry over to the job, so you would need to delete the existing job and create a new one with the updated code. If you have jq installed, these commands would fairly quickly show you the stored code, just need to update the user, job id and baseurl with what is correct for your environment.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;baseurl=https://viya.demo.sas.com
user=&amp;lt;user_id&amp;gt;
read -s -p "Enter password: " pass
id=&amp;lt;job_id&amp;gt;
token=$(curl -s -L -X POST "$baseurl/SASLogon/oauth/token" -H 'Accept: application/json' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Authorization: Basic c2FzLmNsaTo=' -d 'grant_type=password' -d "username=$user" -d "password=$pass" | sed "s/{.*\"access_token\":\"\([^\"]*\).*}/\1/g")
curl -s -L $baseurl/jobExecution/jobRequests/$id -H "Authorization: Bearer $token" | jq -r '.jobDefinition.code'&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Jul 2021 13:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/757125#M1033</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2021-07-27T13:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: sas viya jsf scheduled jobs and flows</title>
      <link>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/758783#M1039</link>
      <description>sorry, may i know what is JQ ? thanks</description>
      <pubDate>Mon, 02 Aug 2021 13:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/758783#M1039</guid>
      <dc:creator>elisehoo1</dc:creator>
      <dc:date>2021-08-02T13:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: sas viya jsf scheduled jobs and flows</title>
      <link>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/758784#M1040</link>
      <description>jq is a command-line application that can process JSON.&lt;BR /&gt;&lt;A href="https://stedolan.github.io/jq/" target="_blank"&gt;https://stedolan.github.io/jq/&lt;/A&gt;</description>
      <pubDate>Mon, 02 Aug 2021 13:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/758784#M1040</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2021-08-02T13:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: sas viya jsf scheduled jobs and flows</title>
      <link>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/758806#M1041</link>
      <description>&lt;P&gt;Just curious, is there no option to "redeploy" an existing job?&amp;nbsp; With SAS 9.4 / DI studio there is a "redeploy."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option, which I use in 9.4 / DI studio is to have your deployed job just be a singe %INCLUDE statement which includes the real program.&amp;nbsp; So the deployed job foo is just %include foo.sas.&amp;nbsp; Then you can update foo.sas any time you want, and the deployed job doesn't need to change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't tried Viya yet, but it works well on 9.4 BI server.&amp;nbsp; Typically I try to write my SAS code (foo.sas) in a way that it will run when called from DI studio or EG or as a batch submission or whatever.&amp;nbsp; I only create a "job" when I want to schedule something.&amp;nbsp; The job is just a wrapper object that points to existing code.&amp;nbsp; In fact, most of my jobs are exactly the same, because they just %include /&amp;amp;project/Code/&amp;amp;jobname..sas /source2.&amp;nbsp; &amp;nbsp; The value for &amp;amp;project and &amp;amp;jobname come from the name of the job and metadata path.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 15:03:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/758806#M1041</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2021-08-02T15:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: sas viya jsf scheduled jobs and flows</title>
      <link>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/758829#M1042</link>
      <description>I'm not aware of any redeploy functionality as exists in SAS 9.4. The solution of using an include statement would work in Viya, assuming the path to the program is present on all the compute server hosts. I'm not sure about the ability to use macro variables in the include statement as the job name / path isn't known to the program.</description>
      <pubDate>Mon, 02 Aug 2021 16:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/758829#M1042</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2021-08-02T16:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: sas viya jsf scheduled jobs and flows</title>
      <link>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/758837#M1043</link>
      <description>&lt;P&gt;Gotcha, thanks.&amp;nbsp; I would think redeploy would be a handy feature for the backlog.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In 9.4, looks like there were macro variables&amp;nbsp; &amp;amp;ETLS_JOBNAME and &amp;amp;JOBID but for the path I had to use the &amp;amp;JOBID to crawl the metadata.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 16:48:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/758837#M1043</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2021-08-02T16:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: sas viya jsf scheduled jobs and flows</title>
      <link>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/758856#M1044</link>
      <description>These variables are not present in Viya. I created a job with %put _all_ and executed it and found these variables set. I also didn't see any in the environment variables.&lt;BR /&gt;&lt;BR /&gt;normal: GLOBAL SYS_COMPUTE_DATA /opt/sas/viya/config/data/compsrv/default&lt;BR /&gt;normal: GLOBAL SYS_COMPUTE_JOB_ID 64FC27DA-E57D-7E44-BAA3-187CE2220F8C&lt;BR /&gt;normal: GLOBAL SYS_COMPUTE_SESSION_ID f027c925-2d8c-4d90-b8a0-8fd6e2769cc7-ses0000&lt;BR /&gt;normal: GLOBAL SYS_COMPUTE_SESSION_OWNER grwoot&lt;BR /&gt;normal: GLOBAL SYS_JES_JOB_URI /jobExecution/jobs/5d52283b-028d-4eac-a2b7-1186d3af6b43&lt;BR /&gt;normal: GLOBAL _CONTEXTNAME SAS Job Execution compute context</description>
      <pubDate>Mon, 02 Aug 2021 17:52:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/sas-viya-jsf-scheduled-jobs-and-flows/m-p/758856#M1044</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2021-08-02T17:52:10Z</dc:date>
    </item>
  </channel>
</rss>

