Print Page as PDF
XUTMDEVQ ICR (1519)

XUTMDEVQ    ICR (1519)

Name Value
NUMBER 1519
IA # 1519
DATE CREATED 1996/03/29
CUSTODIAL PACKAGE KERNEL
CUSTODIAL ISC San Francisco
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE XUTMDEVQ
NAME XUTMDEVQ
GENERAL DESCRIPTION
These APIs allow you to run jobs directly or queue
them, whether printing to a device or not, and enable varying degrees of user
interaction.  See the TaskMan: Developer Tools section of the Kernel
Developer's Guide for further information.

EN^XUTMDEVQ: Use this to allow the user to decide whether to run the job
directly or queue it. The user may select the device and the start time.

If a task is long-running, and has an output device, it will tie up the output
device for the whole time. That's not desirable. We've created a way for you
to split the job into two tasks: gather and print. The user may select the
device and the start time.
$$QQ^XUTMDEVQ(): Double Queue- This API creates the Gather and Print tasks.
The gather task is scheduled to run, while the print task is not scheduled.
The gather task collects data and stores it, perhaps in ^XTMP.  When the
gather task is finished, the gather task can schedule the print task.
$$REQQ^XUTMDEVQ(): Schedule the Print task that was created by $$QQ^XUTMDEVQ.

The print task prints the data that was stored by the gather task.  This API
should be invoked at the end of the Gather task to print the results.

$$DEV^XUTMDEVQ(): Use this to force the user to queue a job. The user may
select the device and start time.

$$NODEV^XUTMDEVQ(): Use this to force the user to queue a job which doesn't
need any device. The user may select the start time.

STATUS Active
DURATION Till Otherwise Agreed
ID XUTMDEVQ
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
EN
EN^XUTMDEVQ(ztrtn, ztdesc, ztsave [, %zis] [,
retztsk])

Input Parameters:

ztrtn  - The entry point EN^XUTMDEVQ will DO to start the job.  Specify it as
"LABEL^ROUTINE" or "^ROUTINE" or "ROUTINE"

ztdesc - Task description, up to 200 characters describing the task, with the
package name at the front.

ztsave - This parameter is passed by reference. Set up this array in the same
format as the ZTSAVE input array is set up for a ^%ZTLOAD TaskMan entry point.

%zis   - (optional) Pass by reference or value. Any parts of the %ZIS variable
that is to be used in the ^%ZIS device call.

retztsk - (optional) If the job is tasked, and you want to know the task
number ZTSK, then set this parameter such that $G(retztsk).

Output:

ZTSK   - (optional output) If $G(retztsk), and the job is tasked, ZTSK will
hold the task number upon exit from this API.


VARIABLES TYPE
ztrtn Input
ztdesc Input
ztsave Input
%zis Input
retztsk Input
ZTSK Output
$$QQ
$$QQ^XUTMDEVQ(%rtn1 [, %desc1] [, %var1] [, %voth1]
[, %zis] [, iop] [, %wr]
%rtn2 [, %desc2] [, %var2] [, %voth2])

Double Queue- This API creates the Gather and Print tasks.  The gather task is
scheduled to run, while the print task is not scheduled.  The gather task
collects data and stores it, perhaps in ^XTMP.  When the gather task is
finished, the gather task must schedule the print task using $$REQQ^XUTMDEVQ.
The ^XTMP location used in the gather task can be passed to the print task in
a parameter in $$REQQ^XUTMDEVQ.

Input Parameters:

%rtn1  - (required) 1st task that TaskMan will run, usually a
search-and-build-sorted-data type process. May be specified as "LABEL^ROUTINE"
or "^ROUTINE" or "ROUTINE".

%desc1 - (optional) Description (up to 200 chars) of 1st task. Default is
%rtn1, with ~ substituted for ^.

%var1  - (optional) ZTSAVE values for 1st task. Single value or passed by
reference, this will be used to SET ZTSAVE(). It may be a string of variable
names separated by ";". Each ;-piece will be used as a subscript in ZTSAVE.
See the ^%ZTLOAD TaskMan API documentation for a description of the ZTSAVE
variable.

%voth1 - (optional) Other parameters for 1st task. Passed by reference,
%voth1(sub)="" or explicit value sub - this is any other ^%ZTLOAD API variable
besides ZTRTN, ZTDESC, ZTIO or ZTSAVE. For example, S %VOTH1("ZTDTH")=$H.

%zis   - (optional) Passed by reference, this is the standard %ZIS variable
array for calling the Device Handler ^%ZIS. The 2nd task of the job will be
tasked to this device. Exception:
- If %D(%ZIS)=0 then the default value is "MQ", and call the Device Handler.
- If $D(%ZIS)=1,%ZIS="" then queue the 2nd task also with ZTIO="" (i.e. Do
not call the Device Handler.)

iop    - (optional) The IOP variable as defined in Kernel's Device Handler
^%ZIS. Default value is "Q". If IOP is passed, but does not include "Q", then
"Q" is added.

%wr    - (optional) If %wr>0 then write text to the screen as to whether or
not the queueing was successful.

%rtn2  - (required) 2nd task that TaskMan will run, usually a print process.
May be specified as "LABEL^ROUTINE" or "^ROUTINE" or "ROUTINE".

%desc2 - (optional) Description (up to 200 chars) of 2nd task. Default is
%rtn1, with ~ substituted for ^.

%var2  - (optional) ZTSAVE values for 2nd task. Single value or passed by
reference, this will be used to SET ZTSAVE(). It may be a string of variable
names separated by ";". Each ;-piece will be used as a subscript in ZTSAVE.
If %var2 is not passed, but %var1 is, then %var1 is merged into %var2 by
default.

%voth2 - (optional) Other parameters for 2nd task. Passed by reference,
%voth2(sub)="" or explicit value sub - this is any other ^%ZTLOAD API variable
besides ZTRTN, ZTDESC, ZTIO or ZTSAVE. However, if %voth2("ZTDTH")=$H, that
setting is ignored, because the 2nd task is not scheduled.

Output:

If successful, Function returns ztsk1^ztsk2 (ZTSK values of the 1st and 2nd
tasks. If unsuccessful, it returns -1.

VARIABLES TYPE
$$QQ Output
%rtn1 Input
%desc1 Input
%var1 Input
%voth1 Input
%zis Input
iop Input
%wr Input
%rtn2 Input
%desc2 Input
%var2 Input
%voth2 Input
$$REQQ
$$REQQ^XUTMDEVQ(xutsk, xudth [,[.]%var])

Schedule the Print task that was created by $$QQ^XUTMDEVQ.  The print task
prints the data that was stored by the gather task. This API should be invoked
at the end of the Gather (1st) task to print the results.

Input Parameters:

xutsk    - (required) This is the task number of the 2nd task which was
created by $$QQ^XUTMDEVQ, but not scheduled. The task number is found in the
variable XUTMQQ.

xudth    - (required) This is the date/time to run the task. To start it right
away, use $H.

[.]%var  - (optional) ZTSAVE values for 2nd task. Single value or passed by
reference, this will be used to SET ZTSAVE(). It may be a string of variable
names separated by ";". Each ;-piece will be used as a subscript in ZTSAVE.
See the ^%ZTLOAD TaskMan API documentation for a description of the ZTSAVE
variable.  Use this parameter to pass the ^XTMP node location under which all
the data from the gather task has been saved.

Output:

Function returns 1 if successful; 0 if not.

VARIABLES TYPE
xutsk Input
xudth Input
%var Input
$$REQQ Output
$$DEV
$$DEV^XUTMDEVQ(ztrtn [,ztdesc] [,%var] [,%voth]
[,%zis] [,iop] [,%wr])

Use this to force the user to queue a job. The user may select the device and
start time.

Input Parameters:

ztrtn  - (required) Routine that TaskMan will run. May be specified as
"LABEL^ROUTINE" or "^ROUTINE" or "ROUTINE".

ztdesc - (optional) Task description (up to 200 chars). Default is ztrtn, with
~ substituted for ^.

%var   - (optional) ZTSAVE values for task. Single value or passed by
reference, this will be used to SET ZTSAVE(). It may be a string of variable
names separated by ";". Each ;-piece will be used as a subscript in ZTSAVE.
See the ^%ZTLOAD TaskMan API documentation for a description of the ZTSAVE
variable.

%voth  - (optional) Other parameters for task. Passed by reference,
%voth1(sub)="" or explicit value sub - this is any other ^%ZTLOAD API variable
besides ZTRTN, ZTDESC, ZTIO or ZTSAVE. For example, S %VOTH1("ZTDTH")=$H.

%zis   - (optional) Passed by reference, this is the standard %ZIS variable
array for calling the Device Handler ^%ZIS. If it doesn't contain "Q", "Q"
will be added to it. The default value is "MQ".

iop    - (optional) The IOP variable as defined in Kernel's Device Handler
^%ZIS. Default value is "Q".

%wr    - (optional) If %wr>0 then write text to the screen as to whether or
not the queueing was successful.

Output:

Function returns 0 if run ztrtn without queueing; -1 if unsuccessful.

VARIABLES TYPE
ztrtn Input
ztdesc Input
%var Input
%voth Input
%zis Input
iop Input
%wr Input
$$DEV Output
$$NODEV
$$NODEV^XUTMDEVQ(ztrtn [,ztdesc] [,%var] [,%voth]
[,%wr])

Use this function to force the user to queue a job which doesn't need any
device. The user may select the start time.

Input Parameters:

ztrtn  - (required) Routine that TaskMan will run. May be specified as
"LABEL^ROUTINE" or "^ROUTINE" or "ROUTINE".

ztdesc - (optional) Task description (up to 200 chars). Default is ztrtn, with
~ substituted for ^.

%var   - (optional) ZTSAVE values for task. Single value or passed by
reference, this will be used to SET ZTSAVE(). It may be a string of variable
names separated by ";". Each ;-piece will be used as a subscript in ZTSAVE.
See the ^%ZTLOAD TaskMan API documentation for a description of the ZTSAVE
variable.

%voth  - (optional) Other parameters for task. Passed by reference,
%voth1(sub)="" or explicit value sub - this is any other ^%ZTLOAD API variable
besides ZTRTN, ZTDESC, ZTIO or ZTSAVE. For example, S %VOTH1("ZTDTH")=$H.

%wr    - (optional) If %wr>0 then write text to the screen as to whether or
not the queueing was successful.

Output:

Function returns 1 if scheduling is successful; 0 if not.

VARIABLES TYPE
ztrtn Input
ztdesc Input
%var Input
%voth Input
%wr Input
$$NODEV Output
DATE ACTIVATED 2012/06/20