$TsoCan: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 9: Line 9:


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %RESULT = $TsoCan(task_id)
<p class="syntax"><section begin="syntax" />%result = $TsoCan(task_id)
<section end="syntax" /></p>
<section end="syntax" /></p>


<p class="caption">%RESULT is set either to the status code for the cancelled task or to an error code.</p>
===Syntax terms===
The first argument is a number that is the task id of the "task" for which status is requested. This is an optional argument and if omitted indicates that you want all tasks to be cancelled.
<table class="syntaxTable">
<tr><th>%result</th>
<td>Either the status code for the cancelled task or an [[#Error codes|error code]].</td></tr>


===Status codes===
<tr><th>task_id</th>
<td>The number that is the task id of the "task" for which status is requested. This is an optional argument; omitting it indicates that you want all tasks to be cancelled.</td></tr>
</table>
 
===Error codes===
<var>$TsoCan</var> normally returns the status code of the cancelled task. If there is some error that prevents the task from being cancelled, however, a negative error code is returned to indicate the problem.
<var>$TsoCan</var> normally returns the status code of the cancelled task. If there is some error that prevents the task from being cancelled, however, a negative error code is returned to indicate the problem.



Revision as of 19:37, 24 October 2012

Cancel program invoked via $TsoAtt

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $TsoCan function.

This function cancels a specific task running a program invoked via $TsoAtt or all such tasks initiated by the current user.

Note: This function requires the special version of the TSO full screen interface to Model 204 that is distributed by Sirius Software.

The $TsoCan function accepts one argument and returns a numeric status code or count.

Syntax

<section begin="syntax" />%result = $TsoCan(task_id) <section end="syntax" />

Syntax terms

%result Either the status code for the cancelled task or an error code.
task_id The number that is the task id of the "task" for which status is requested. This is an optional argument; omitting it indicates that you want all tasks to be cancelled.

Error codes

$TsoCan normally returns the status code of the cancelled task. If there is some error that prevents the task from being cancelled, however, a negative error code is returned to indicate the problem.

-1 - Connection broken -4 - Not a TSO full screen IODEV (IODEV 11) -8 - Incorrect version of TSO interface -20 - LOUTPB too small

Example

The following program invokes a program called 'COMPRESS' in the user's TSO address space with a parameter of 'DSN(JUNK.CNTL)', issues a FIND while 'COMPRESS' is running, and then cancels the 'COMPRESS' command if it is still running.

B %TASKID = $TsoAtt( 'COMPRESS', , 'DSN(JUNK.CNTL)') FIND1: IN BIGFILE FIND ALL RECORDS FOR WHICH NAME IS LIKE 'SM*' END FIND %RC = $TsoCan( %TASKID ) ... END


Products authorizing $TsoCan