<?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: Executing TSO command thru SAS batch job in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713977#M27237</link>
    <description>&lt;P&gt;Why not just use the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0h945u5r0cv6yn1u6qs35hiqt9t.htm&amp;amp;locale=en" target="_self"&gt;FDELETE()&lt;/A&gt; function instead?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA TEST;
  RC1=FILENAME('XXX', 'RC.SAMPLE.SAS.UPGR');
  RC2=FDELETE('XXX');
  PUT RC1= RC2=;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 25 Jan 2021 16:51:34 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-01-25T16:51:34Z</dc:date>
    <item>
      <title>Executing TSO command thru SAS batch job</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713956#M27233</link>
      <description>&lt;P&gt;I want to execute a TSO command from my SAS job. I executed the following,&lt;/P&gt;&lt;DIV&gt;&lt;FONT&gt;//STEP01&amp;nbsp;&amp;nbsp; EXEC SAS&lt;BR /&gt;//SYSIN&amp;nbsp;&amp;nbsp;&amp;nbsp; DD&amp;nbsp;&amp;nbsp; *&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;DATA TEST;&lt;BR /&gt;TSO DEL 'RC.SAMPLE.SAS.UPGR'&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;RUN;&lt;BR /&gt;/*&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;The job ended with RC 0 but I see the following (error?) in SASLOG,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT&gt;1&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATA TEST;&lt;BR /&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TSO DEL 'RC.SAMPLE.SAS.UPGR'&lt;BR /&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN&lt;BR /&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#ff6600"&gt; !&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;NOTE: The data set WORK.TEST has 1 observations and 0 variables.&lt;BR /&gt;NOTE: The DATA statement used 0.00 CPU seconds and 23258K.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;Can someone please help me understand what is wrong with this code?&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713956#M27233</guid>
      <dc:creator>DuraiN</dc:creator>
      <dc:date>2021-01-25T16:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Executing TSO command thru SAS batch job</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713958#M27234</link>
      <description>&lt;P&gt;Your SAS code is missing a semi-colon to end the TSO statement.&amp;nbsp; Also I doubt that you need either the DATA or the RUN statement to execute the TSO statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I don't know if you can actually run TSO commands from JCL batch.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713958#M27234</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-25T16:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Executing TSO command thru SAS batch job</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713970#M27235</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your response! I was getting the following error (i.e. an exclamatory mark next to the semi-colon) earlier which is why I removed the semi-colon from the TSO statement,&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;1&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATA _NULL_;&lt;BR /&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TSO DEL 'RC.SAMPLE.SAS.UPGR'&lt;BR /&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;I saw the following detail in SAS 9.4 Companion for z/OS, Third edition so wanted to check this feature of executing TSO commands from SAS,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&lt;FONT&gt;TSO Function: z/OS&lt;BR /&gt;Issues an operating environment command during a SAS session and returns the system return code.&lt;BR /&gt;Restriction:&lt;BR /&gt;A TSO command executes successfully only in a TSO SAS session. In a non-TSO session, the command is disabled and the return code is set to 0.&lt;BR /&gt;z/OS specifics:&lt;BR /&gt;All&lt;BR /&gt;SyntaxTSO(command)&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&lt;FONT&gt;Required Argument&lt;BR /&gt;command&lt;BR /&gt;can be a system command enclosed in quotation marks, an expression whose value is a system command, or the name of a character variable whose value is a system command. Under z/OS, "system command" includes TSO commands, CLISTs, and REXX execs.&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713970#M27235</guid>
      <dc:creator>DuraiN</dc:creator>
      <dc:date>2021-01-25T16:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Executing TSO command thru SAS batch job</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713974#M27236</link>
      <description>&lt;P&gt;It sounds like you cannot run TSO commands from batch jobs. But why not run the TSO() function instead of the TSO statement and see what return code you get?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _NULL_;
  RC= TSO("DEL 'RC.SAMPLE.SAS.UPGR'");
  PUT RC=;
RUN:&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713974#M27236</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-25T16:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Executing TSO command thru SAS batch job</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713977#M27237</link>
      <description>&lt;P&gt;Why not just use the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0h945u5r0cv6yn1u6qs35hiqt9t.htm&amp;amp;locale=en" target="_self"&gt;FDELETE()&lt;/A&gt; function instead?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA TEST;
  RC1=FILENAME('XXX', 'RC.SAMPLE.SAS.UPGR');
  RC2=FDELETE('XXX');
  PUT RC1= RC2=;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:51:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713977#M27237</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-25T16:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Executing TSO command thru SAS batch job</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713979#M27238</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran the code you suggested, it ended with RC 0 and I dont see any errors from SASLOG (provided below) but the file is not deleted,&lt;/P&gt;&lt;DIV&gt;&lt;FONT&gt;1&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATA _NULL_;&lt;BR /&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RC=TSO("DEL 'RC.SAMPLE.SAS.UPGR'");&lt;BR /&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PUT RC=;&lt;BR /&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;RC=0&lt;BR /&gt;NOTE: The DATA statement used 0.00 CPU seconds and 23366K&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 25 Jan 2021 17:01:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713979#M27238</guid>
      <dc:creator>DuraiN</dc:creator>
      <dc:date>2021-01-25T17:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Executing TSO command thru SAS batch job</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713985#M27239</link>
      <description>Thanks for your suggestion Tom! but the idea behind testing the SAS-TSO interface was to test the features in current version of SAS and then do the test again after we upgrade the version. But may be I cannot run TSO commands from SAS..</description>
      <pubDate>Mon, 25 Jan 2021 17:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713985#M27239</guid>
      <dc:creator>DuraiN</dc:creator>
      <dc:date>2021-01-25T17:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Executing TSO command thru SAS batch job</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713989#M27240</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/365765"&gt;@DuraiN&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran the code you suggested, it ended with RC 0 and I dont see any errors from SASLOG (provided below) but the file is not deleted,&lt;/P&gt;
&lt;DIV&gt;&lt;FONT&gt;1&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATA _NULL_;&lt;BR /&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RC=TSO("DEL 'RC.SAMPLE.SAS.UPGR'");&lt;BR /&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PUT RC=;&lt;BR /&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;RC=0&lt;BR /&gt;NOTE: The DATA statement used 0.00 CPU seconds and 23366K&lt;/FONT&gt;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That seems consistent with the documentation text you posted before.&amp;nbsp; You cannot run TSO commands from SAS launched via JCL, only from SAS launched via TSO command.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 17:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/713989#M27240</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-25T17:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Executing TSO command thru SAS batch job</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/714022#M27246</link>
      <description>&lt;P&gt;To test TSO commands in SAS you need to launch SAS from a TSO command line using: TSO SAS (your launch script may have a different name). I'm assuming that TSO SAS is available to you though.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 18:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/714022#M27246</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-01-25T18:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Executing TSO command thru SAS batch job</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/714287#M27280</link>
      <description>Categorization: Unclassified&lt;BR /&gt;&lt;BR /&gt;Thanks for your response! Yes we have a TSO SAS session available...will run it thru it&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Jan 2021 15:22:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Executing-TSO-command-thru-SAS-batch-job/m-p/714287#M27280</guid>
      <dc:creator>DuraiN</dc:creator>
      <dc:date>2021-01-26T15:22:13Z</dc:date>
    </item>
  </channel>
</rss>

