<?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: Is there a way to start a control-M job via a SAS Code in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/966020#M45928</link>
    <description>I was checking just in case.  Is there a way to send a return code from SAS program to have the Control-M job to failed&lt;BR /&gt;</description>
    <pubDate>Wed, 07 May 2025 20:39:44 GMT</pubDate>
    <dc:creator>alepage</dc:creator>
    <dc:date>2025-05-07T20:39:44Z</dc:date>
    <item>
      <title>Is there a way to start a control-M job via a SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/965754#M45921</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;usually, control-M will execute a Kernel Script hosted on our Unix server, then passed few parameters such as the order date, and finally, we use a sysparm command to pass the order date and execute a specific sas code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wonder if there is a way to trigger a control-M job such a file transfer, via a SAS code.&lt;BR /&gt;If so, please provide an example.&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2025 14:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/965754#M45921</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2025-05-05T14:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to start a control-M job via a SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/965816#M45922</link>
      <description>&lt;P&gt;The X and %Sysexec statements, System and Call System functionswill execute operating system instructions. So would work to execute a known script as you would provide that as part of the call. &lt;STRONG&gt;HOWEVER&lt;/STRONG&gt;, many SAS shops disable the functionality of these statements.&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2025 19:17:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/965816#M45922</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-05-05T19:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to start a control-M job via a SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/965820#M45923</link>
      <description>&lt;P&gt;Wouldn't it just be a lot easier to use the Control-M user interface?&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2025 20:12:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/965820#M45923</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-05-05T20:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to start a control-M job via a SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/965822#M45924</link>
      <description>&lt;P&gt;The purpose of a tool like Control-M is that&amp;nbsp;&lt;STRONG&gt;EVERYTHING&lt;/STRONG&gt; is run&amp;nbsp;&lt;STRONG&gt;FROM THERE&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Have all dependencies implemented in the scheduler; if you need to react to the result of a SAS job, use clearly defined exit codes for this.&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2025 20:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/965822#M45924</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-05-05T20:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to start a control-M job via a SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/966020#M45928</link>
      <description>I was checking just in case.  Is there a way to send a return code from SAS program to have the Control-M job to failed&lt;BR /&gt;</description>
      <pubDate>Wed, 07 May 2025 20:39:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/966020#M45928</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2025-05-07T20:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to start a control-M job via a SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/966038#M45933</link>
      <description>&lt;P&gt;Yes.&amp;nbsp; SAS will set the error code when it exits, which you can then test.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this example the error code was set to 5:&lt;/P&gt;
&lt;PRE&gt;  1? options errorabend;
  2? data x.y.z; run;

2    data x.y.z; run;
          -----
          211
ERROR 211-185: Invalid data set name.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds


ERROR: SAS ended due to errors.
       You specified: OPTIONS ERRORABEND;.
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
      real time           17.24 seconds
      cpu time            0.04 seconds

&amp;gt;echo $?
5
&lt;/PRE&gt;
&lt;P&gt;Or you can use the ABORT statement with the RETURN option and return an error number you want.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&amp;gt;sas -noautoexec -nodms
...
NOTE: SAS initialization used:
      real time           0.06 seconds
      cpu time            0.03 seconds

  1? data _null_; abort return 27; run;

ERROR: Execution terminated by an ABORT statement at line 1 column 14,
       it specified the RETURN option.
_ERROR_=1 _N_=1
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
      real time           13.24 seconds
      cpu time            0.03 seconds

&amp;gt;echo $?
27
&lt;/PRE&gt;
&lt;P&gt;Now you just need to ask the makers of that other software how to detect the return code of a program you used it to run.&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 03:10:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Is-there-a-way-to-start-a-control-M-job-via-a-SAS-Code/m-p/966038#M45933</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-05-08T03:10:15Z</dc:date>
    </item>
  </channel>
</rss>

