NetBatch Management Programming Manual
Sample Programs
NetBatch Management Programming Manual—522462-003
C-45
Sample TAL Program
work^length := @ptr '-' @work^area;
IF (error := SSPUTTKN(spi^buf, zbat^tkn^executor^program, work^length))
THEN
stopwitherror(essput, 12);
-- Insertvolume-subvol token
temp ':=' sm[_defaults] for 8 & "INFILE ";-- Get <vol>.<subvol> from
startup-message
error :=
OLDFILENAME_TO_FILENAME_(temp, work^area:maxfilebytes,
work^length);-- C-series filename to D-
series format
work^length := work^length - 7;
IF (error := SSPUTTKN(spi^buf, ZBAT^TKN^VOLUME^SUBVOL, work^length)) THEN
stopwitherror(essput, 12);
! Insert in-file token
work^length := work^length + 7; -- Use data already in buffer
IF (error := SSPUTTKN(spi^buf, ZBAT^TKN^IN^FILE, work^length)) THEN
stopwitherror(essput, 12);
! Insert out-file token
work^area ':=' "$S.#MASTERA" -> @ptr;
work^length := @ptr '-' @work^area;
IF (error := SSPUTTKN(spi^buf, ZBAT^TKN^OUT^FILE, work^length)) THEN
stopwitherror(essput, 12);
-- Initialize the ZBAT-MAP-DEF-JOB structure
IF (error := SSNULL(job^map, job)) THEN
stopwitherror(essnull, 13);
job.zclassname ':=' "CLASS-A "; -- Class name
job.zhold := -- Hold ON
job.zhold^after := zspi^val^true; -- Holdafter ON
job.zdefault^security := %4444; -- Security NNNN
-- Put the job definition structure details into the SPI buffer
IF error := SSPUT (spi^buf -- SPI buffer
, job^map -- Token map
, job) THEN -- Token value
stopwitherror(essput, 12);
RETURN SEND^SPI;
END; -- SUBMIT^JOB
--------------------------------------------------------------------------
------
-- The STATUS^JOB function procedure.
-- This function procedure formats a SPI buffer for the scheduler
-- to get the status of the job submitted. This procedure uses
-- the job number returned by the scheduler as a result of the
-- SUBMIT command to identify the job.
--------------------------------------------------------------------------
------
INT PROC STATUS^JOB(JNUM);
(continued)