 |
» |
|
 |
|
 |

Copyright (c) Digital Equipment Corporation 1985. All rights reserved
OVERVIEW:
This example program will prompt the user for a file name and a queue
name and then enter the "job" into that queue. It uses the new VMS V4
system service $SNDJBC.
NOTE: The example is written for PL/I V2.3 and has been tested using that
version on VAX/VMS Version 4.1. PL/I versions earlier than 2.3 will *not*
have the new VMS V4.0 system service definitions and thus cannot use the
same code exactly. This example can, however, serve as a template. If
you're using an earlier version, be sure to modify $SNDJBC to be
explicitly declared and declare any SJC$ variables as globalref value.
The length of this article is about 100 lines.
PROGRAM EXAMPLE:
JBC: PROCEDURE OPTIONS (MAIN);
%INCLUDE SYS$SNDJBC; /* Valid for PL/I V2.3 only */
%INCLUDE $SJCDEF; /* Valid for PL/I V2.3 only */
%INCLUDE SYS$WFLOR;
%INCLUDE $STSDEF;
DCL EFN FIXED BIN(31) INIT(3);
DCL FUNC FIXED BIN(31) INIT(SJC$_ENTER_FILE);
DCL NULLARG FIXED BIN(31) INIT(0);
DCL IOSB(4) FIXED BIN(15);
DCL MASK BIT(32) INIT('0000000000000000000000000000000100'B);
/* Define the item list structure for $SNDJBC */
DCL 01 ITMLST,
02 FILE_SPEC,
03 BL_1 FIXED BIN(15),
03 IC_1 FIXED BIN(15) INIT(SJC$_FILE_SPECIFICATION),
03 BA_1 POINTER,
03 RLA_1 POINTER,
02 NOTIFY,
03 BL_1 FIXED BIN(15) INIT(0),
03 IC_1 FIXED BIN(15) INIT(SJC$_NOTIFY),
03 BA_1 POINTER,
03 RLA_1 POINTER,
02 QUEUE,
03 BL_1 FIXED BIN(15),
03 IC_1 FIXED BIN(15) INIT(SJC$_QUEUE),
03 BA_1 POINTER,
03 RLA_1 POINTER,
02 END_LIST FIXED BIN(31) INIT(0);
DCL FILE CHARACTER(64);
DCL QUEUE CHARACTER(25);
/* Obtain the file name of the job to queue */
PUT SKIP LIST('Please input full file specification of the job');
PUT SKIP LIST('to queue. (Ex. DISK1:[HOME]BATCH.JOB) ');
GET LIST(FILE);
/* Obtain the Queue name in which to submit the job to */
PUT SKIP LIST('Please input Queue name to submit the job to: ');
GET LIST(QUEUE);
/* Set the addresses in the item list for the file and queue names */
ITMLST.FILE_SPEC.BA_1 = ADDR(FILE);
ITMLST.FILE_SPEC.BL_1 = 64;
ITMLST.QUEUE.BA_1 = ADDR(QUEUE);
ITMLST.QUEUE.BL_1 = 25;
/* Call $SNDJBC now */
STS$VALUE = SYS$SNDJBC(EFN, FUNC, NULLARG, ITMLST, IOSB , , );
IF ^STS$SUCCESS THEN SIGNAL VAXCONDITION(STS$VALUE);
/* Wait for the service to complete */
STS$VALUE = SYS$WFLOR(EFN, MASK);
IF ^STS$SUCCESS THEN SIGNAL VAXCONDITION(STS$VALUE);
IF IOSB(1) > 1 THEN SIGNAL VAXCONDITION(IOSB(1));
PUT SKIP LIST('Please check ',queue,' for your job');
END JBC;
|
buy online or call 1.800.AT.COMPAQ
|
|