NetBatch Management Programming Manual

Sample Programs
NetBatch Management Programming Manual522462-003
C-44
Sample TAL Program
CALL FILE_GETINFO_(schd_chan, error);
stopwitherror(ewrite_readx_, 16);
END;
-- Read tokens returned in SPI buffer
IF error := SSGETTKN(spi^buf
, zspi^tkn^retcode
, retcode
, 1) THEN
stopwitherror(essget, 12);
RETURN retcode;
END;
--------------------------------------------------------------------------
-------------------------
-- SUBMIT^JOB function procedure.
-- This function procedure formats the SPI buffer for NetBatch
-- and submits a job to $ZBAT. The job only has the IN, OUT,
-- EXECUTOR-PROGRAM, CLASS, VOLUME, HOLD, and HOLDAFTER
-- attributes.
--------------------------------------------------------------------------
------------------------
INT PROC SUBMIT^JOB;
BEGIN
INT error; -- General error variables
INT job^map[0:zbat^map^def^job^wln] := zbat^map^def^job;
STRING .ptr; -- Work pointer
-- Initialize the SPI buffer
if (error := SSINIT( spi^buf
, (zbat^val^buflen^min+6)
, zbat^val^ssid^init
, zspi^val^cmdhdr
, zbat^cmd^submit -- Submit command token
, zbat^obj^job -- Job object token
, 0 -- MAXRESP
,
, zspi^val^true)) then -- Enable checksum
stopwitherror(essinit, 13);
-- Insert job-name token
work^area ':=' "MASTER-A" -> @ptr;
work^length := @ptr '-' @work^area;
IF (error := SSPUTTKN(spi^buf, zbat^tkn^sel^jobname, work^length)) THEN
-- CALL PROCESS_STOP_(,,,2!cc!,error!ti!,,essput:12);
stopwitherror(essput, 12);
-- Insert executor-program token
work^area ':=' "$SYSTEM.SYSTEM.TACL" -> @ptr;
(continued)