<?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: Can we execute a job flow through API? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-we-execute-a-job-flow-through-API/m-p/917845#M361549</link>
    <description>&lt;P&gt;Can you use the job chaining macros that are provided with the Job Execution Webapp?&lt;/P&gt;&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/sasstudiocdc/v_047/pgmsascdc/jobexecug/p0qsxn76pbh5qjn1iob6uk06nm5f.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/sasstudiocdc/v_047/pgmsascdc/jobexecug/p0qsxn76pbh5qjn1iob6uk06nm5f.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 25 Feb 2024 23:30:40 GMT</pubDate>
    <dc:creator>DeMer</dc:creator>
    <dc:date>2024-02-25T23:30:40Z</dc:date>
    <item>
      <title>Can we execute a job flow through API?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-execute-a-job-flow-through-API/m-p/917349#M361364</link>
      <description>&lt;P&gt;Hi everyone&lt;/P&gt;
&lt;P&gt;I have a job flow that contains&amp;nbsp; jobs inside. Some jobs need to run in parallel. I used to execute it by right click--&amp;gt; execute and set time trigger, and the job flow worked fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mayt_0-1708605633123.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94001i79C964B3E13171B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mayt_0-1708605633123.png" alt="Mayt_0-1708605633123.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The problem is right now I want to execute the job flow through API. But can't find any solution.&lt;/P&gt;
&lt;P&gt;I've tried one solution like Instead of creating a job flow, I created job definition then put the each-step code in it and used %include to run&amp;nbsp;the each-step code. Then executed it through API. But It can't run in parallel and didn't show if there are errors each step.&lt;/P&gt;
&lt;P&gt;My code in job definition is something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*include file*/
FILENAME first_code FILESRVC FOLDERPATH='code path'  FILENAME='mycode1.sas';
FILENAME sec_code FILESRVC FOLDERPATH='code path'  FILENAME='mycode2.sas';
FILENAME third_code FILESRVC FOLDERPATH='code path'  FILENAME='mycode3.sas';

%include first_code;
%if &amp;amp;SYsrc=0 %then %do;
    %put Return Code for first_code: &amp;amp;SYSRC;
    %include sec_code;
    %if &amp;amp;SYsrc=0 %then %do;
        %put Return Code for sec_code: &amp;amp;SYSRC;
        %end;
     %include third_code;
        %if &amp;amp;SYsrc=0 %then %do;
        %put Return Code for third_code: &amp;amp;SYSRC;
        %end;
      &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So if you guys know how to&amp;nbsp;execute the job flow through API, please let me know.&lt;/P&gt;
&lt;P&gt;Thank you in advanced.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 12:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-execute-a-job-flow-through-API/m-p/917349#M361364</guid>
      <dc:creator>Mayt</dc:creator>
      <dc:date>2024-02-22T12:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can we execute a job flow through API?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-execute-a-job-flow-through-API/m-p/917361#M361372</link>
      <description>&lt;P&gt;Yes, SAS Viya has a Job Execution API. You can also list Jobs and get status of running Jobs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See examples here:&lt;BR /&gt;&lt;A href="https://github.com/sassoftware/devsascom-rest-api-samples/blob/master/Compute/jobExecution.md" target="_blank" rel="noopener"&gt;https://github.com/sassoftware/devsascom-rest-api-samples/blob/master/Compute/jobExecution.md&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And documentation:&lt;BR /&gt;&lt;A href="https://developer.sas.com/apis/rest/Compute/#job-execution" target="_blank" rel="noopener"&gt;https://developer.sas.com/apis/rest/Compute/#job-execution&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This Postman collection might also help for testing:&lt;BR /&gt;&lt;A href="https://github.com/sassoftware/sas-rest-api-postman-collections/tree/master/jobs-crud" target="_blank"&gt;https://github.com/sassoftware/sas-rest-api-postman-collections/tree/master/jobs-crud&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 13:57:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-execute-a-job-flow-through-API/m-p/917361#M361372</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2024-02-22T13:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can we execute a job flow through API?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-execute-a-job-flow-through-API/m-p/917532#M361420</link>
      <description>&lt;P&gt;So I need to call the job flow in job definition, Then execute the job definition right? How can I call the job flow in job definition? Can I just use %include like I did in my code. But I think job flow doesn't have path.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 07:00:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-execute-a-job-flow-through-API/m-p/917532#M361420</guid>
      <dc:creator>Mayt</dc:creator>
      <dc:date>2024-02-23T07:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can we execute a job flow through API?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-execute-a-job-flow-through-API/m-p/917845#M361549</link>
      <description>&lt;P&gt;Can you use the job chaining macros that are provided with the Job Execution Webapp?&lt;/P&gt;&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/sasstudiocdc/v_047/pgmsascdc/jobexecug/p0qsxn76pbh5qjn1iob6uk06nm5f.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/sasstudiocdc/v_047/pgmsascdc/jobexecug/p0qsxn76pbh5qjn1iob6uk06nm5f.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Feb 2024 23:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-execute-a-job-flow-through-API/m-p/917845#M361549</guid>
      <dc:creator>DeMer</dc:creator>
      <dc:date>2024-02-25T23:30:40Z</dc:date>
    </item>
  </channel>
</rss>

