 |
» |
|
 |
|
 |

Copyright (c) Digital Equipment Corporation 1992. All rights reserved
LAYERED PRODUCT: VAX PLI OP/SYS: VMS
SOURCE: Digital Customer Support Center
OVERVIEW:
The following program demonstrates how to call the system service
SYS$SNDJBCW. The program making the call submits a .COM file to a
batch queue for processing. The final status of the batch job is
displayed on the screen.
*** CAUTION ***
This sample program has been tested using VAX PLI, Version 3.5 on VMS,
Version 5.5. However, we cannot guarantee its effectiveness because of
the possibility of errors in transmitting or implementing it. It is
meant to be used as a template for writing your own program, and it may
require modification for use on your system.
PROGRAM NOTES:
The program will query the user for the batch queue and the filename
to submit to the batch queue. The filename will be deleted by
$SNDJBC. $SNDJBC is actually called from a subroutine. It was
written this way since many programmers choose to call $SNDJBC from a
subroutine. It should be noted that character strings with the
VARYING attribute should not be passed to the system service. Use a
fixed length string instead. Results are unpredictable when varying
length character strings are used.
PROGRAM:
$ CREATE SNDJBC.PLI
SNDJBC: proc options(main);
%include sys$sndjbc;
%include str$trim;
%include $ssdef;
%include $stsdef;
%include $sjcdef;
dcl queue_name char(31);
dcl file_name char(64);
dcl copies fixed bin(31);
dcl iosb(4) fixed bin(15);
/* The item list specifies the queue name, command filename, and deletion
of the command file at termination of the call */
dcl 1 item_list,
2 part1,
3 buflen1 fixed bin(15) init(0),
3 item1 fixed bin(15) init(SJC$_QUEUE),
3 ptr1 pointer,
3 ptr1a pointer init(null()),
2 part2,
3 buflen2 fixed bin(15) init(0),
3 item2 fixed bin(15) init(SJC$_FILE_SPECIFICATION),
3 ptr2 pointer,
3 ptr2a pointer init(null()),
2 terminator_entry fixed bin(31) init(0);
/* initialize the fields in the item list */
/* User prompts for the queue name and command filename */
put skip list('Enter the queue name:');
get list (queue_name);
put skip list('Enter the file specification:');
get list (file_name);
ptr1 = addr(queue_name);
ptr2 = addr(file_name);
sts$value = str$trim(queue_name,queue_name,buflen1);
if ^sts$success then signal vaxcondition(sts$value);
sts$value = str$trim(file_name,file_name,buflen2);
if ^sts$success then signal vaxcondition(sts$value);
/* perform the system service call
Note: both the return status STS$VALUE and the IOSB are checked for
a successful call. STS$VALUE will indicate if the submission of
the system service call was successful, while the IOSB will
indicate the status of the job submitted to the batch queue */
sts$value = sys$sndjbcw(,sjc$_enter_file,,item_list,iosb,,);
if ^sts$success then signal vaxcondition(sts$value);
if iosb(1) ^= ss$_normal
then do;
put skip list('Problems with SNDJBCW: ', iosb(1));
signal vaxcondition(iosb(1));
end;
put skip list('the iosb was: ',iosb(1));
end sndjbc;
$ PLI SNDJBC
$ LINK SNDJBC
Below is a sample command procedure that may be submitted to the batch
queue. Enter its name (SNDJBC.COM) when prompted for a filename
when running the program.
$CREATE SNDJBC.COM
$DECK
$ write sys$output "This command procedure was submitted by SYS$SNDJBC."
$EOD
The result of this submission to batch will be a log file
called SNDJBC.LOG in your high level directory (SYS$LOGIN).
|
buy online or call 1.800.AT.COMPAQ
|
|