From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 16-APR-1991 15:35:27.69
To:	ARISIA::EVERHART
CC:	
Subj:	SNDJBC examples

From:	RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.97)
	 id AA14040; Tue, 16 Apr 91 14:58:51 EDT
Received: From RELAY.CDNNET.CA by CRVAX.SRI.COM with TCP; Tue, 16 APR 91 11:39:56 PST
Received: by relay.CDNnet.CA (4.1/1.14)
	id AA05163; Tue, 16 Apr 91 11:39:00 PDT
From: <Ed.Wilts@bsc.galaxy.bcsystems.gov.bc.ca>
Date: 16 Apr 91 18:38
To: STEVENS <STEVENS@rad.hup.upenn.edu>
Cc: INFO-VAX <INFO-VAX@sri.com>
Message-Id: <10831161401991/457 01>
Subject: SNDJBC examples

 Fred Stevens asked for some sample code to call the Send to Job Controller 
 system service.  This is being sent to Fred with a cc: to Info-Vax since it 
 is probably useful to others as well.  I don't believe that any special 
 privileges are beyond those needed by the DCL Submit command (ie, you will 
 need CMKRNL to use the /USER qualifier, and you may need additional 
 privileges to submit a job for which you don't have normal RE file access).
 
 Fred,
 
 Here is a routine I wrote a few years ago.  It allows you to build your own 
 submit statement in a high level language and then dispatch it to my 
 subroutine.  It will build the item list for you and finally call SNDJBC.
 
 The code probably isn't too elegant, and I don't know if it supports all 
 the submit qualifiers that you might need, but it worked fine for me.  Let 
 me know how you make out.  I probably should have submitted this to DECUS a 
 while back, but never got around to it...
 
 I included a sample program TEST_DCL.FOR which you can use for testing.  
 TEST_DCL.COM will build the sources and run the test program.  Enter 
 something like SUBMIT/HOLD SYS$LOGIN:LOGIN.  Exit the program and do a SHOW 
 ENTRY xxxx.  The entry number is displayed by the program.
 
 Enjoy!
        .../Ed     Preferrred:  Ed.Wilts@BSC.Galaxy.BCSystems.Gov.BC.CA
Ed Wilts            Alternate:  EdWilts@BCSC02.BITNET    (604) 389-3430
B.C. Systems Corp., 4000 Seymour Place, Victoria, B.C., Canada, V8X 4S8

$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
$!
$! This archive created by VMS_SHARE Version 7.2-007  22-FEB-1990
$!   On 16-APR-1991 09:45:28.18   By user EWILTS (Ed Wilts)
$!
$! This VMS_SHARE Written by:
$!    Andy Harper, Kings College London UK
$!
$! Acknowledgements to:
$!    James Gray       - Original VMS_SHARE
$!    Michael Bednarek - Original Concept and implementation
$!
$! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
$! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
$!
$! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
$!       1. TEST_DCL.COM;1
$!       2. TEST_DCL.FOR;4
$!       3. ECS_SUBMIT.FOR;11
$!       4. SUBMIT.CLD;8
$!
$set="set"
$set symbol/scope=(nolocal,noglobal)
$f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
$e="write sys$error  ""%UNPACK"", "
$w="write sys$output ""%UNPACK"", "
$ if f$trnlnm("SHARE_LOG") then $ w = "!"
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$UNPACK: SUBROUTINE ! P1=filename, P2=checksum
$ if f$search(P1) .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped."
$ delete 'f'*
$ exit
$file_absent:
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'."
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
$ delete 'f'*
$ exit
$dirok:
$ w "-I-PROCESS, Processing file ''P1'."
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
"output_file"));ENDPROCEDURE;Unpacker;QUIT;
$ delete/nolog 'f'*
$ CHECKSUM 'P1'
$ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
$ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ ENDSUBROUTINE
$START:
$ create 'f'
X$!Last Modified: 16-APR-1991 09:43:36 by EWILTS : TEST_DCL.COM
X$ fortran ecs_submit
X$ set comm/obj submit
X$ fortran test_dcl
X$ link test_dcl,ecs_submit,submit
X$ write sys$output "Try a command such as SUBMIT/HOLD SYS$LOGIN:LOGIN"
X$ define/user sys$input sys$command
X$ run test_dcl
$ CALL UNPACK TEST_DCL.COM;1 374353469
$ create 'f'
XCLast Modified:  20-MAR-1989 08:34:10.43 by WILTS`20
X`09CHARACTER*255`09COMMAND_LINE ,
X`091`09`09JOB_STATUS_OUTPUT
X
X`09INTEGER*4`09STATUS,
X`091`09`09LIB$GET_INPUT,
X`092`09`09ECS_SUBMIT,
X`093`09`09LEN_COMMAND_LINE,
X`094`09`09STR$TRIM
X
X`09INTEGER*2`09LEN_JOB_STATUS
X
X
X`09status = 1
X`09do while (status)
X
X`09`09STATUS = LIB$GET_INPUT ( COMMAND_LINE, 'SUBMIT> ',)
X`09`09STATUS = STR$TRIM (COMMAND_LINE, COMMAND_LINE, LEN_COMMAND_LINE)
X`09`09STATUS = ECS_SUBMIT (COMMAND_LINE, JOB_STATUS_OUTPUT, LEN_JOB_STATUS)
X`09`09TYPE *,JOB_STATUS_OUTPUT(1:LEN_JOB_STATUS)
X`09end do
X`09IF (.NOT. STATUS) CALL LIB$STOP(%VAL(STATUS))
X`09CALL EXIT
X`09END
$ CALL UNPACK TEST_DCL.FOR;4 392563696
$ create 'f'
XCLast Modified: 28-JUL-1989 15:07:30 by WILTS : ECS_SUBMIT.FOR
X!`09`09FUNCTION`09-`09SEND BATCH FILE TO JOB CONTROLLER
X!`09`09VERSION`09`09-`091
X!`09`09EDIT`09`09-`091
X!`09`09EDIT DATE`09-`09 6-FEB-1987
X!`09`09SYSTEM`09`09-`09VMS 4.2  / VMS 4.5
X!`09`09AUTHOR`09`09-`09E. WILTS/CANOXY
X
X!DS
X!R`09.HEADER LEVEL 1 *
X!R`09.BLANK 3
X!R`09.HEADER LEVEL 2 Description
X!R`09.P
X!
X!  Although a user can simply close a file with STATUS='SUBMIT', this does n
Vot
X!`09allow any arguments on the SUBMIT command and will always print the
X!`09batch log after running in SYS$BATCH.  The purpose of this routine
X!`09is to allow most of the qualifiers normally allowed on the DCL
X!`09SUBMIT command.  These include
X!`09`09/AFTER
X!`09`09/HOLD
X!`09`09/KEEP
X!`09`09/LOG_FILE
X!`09`09/NAME
X!`09`09/NOTIFY
X!`09`09/PARAMETERS
X!`09`09/PRINTER
X!`09`09/PRIORITY
X!`09`09/QUEUE
X!`09`09/RESTART
X!`09`09/USER
X!`09`09/DELETE
X!H`091 *
X!`09*
X!R`09.P
X!DE
X!FS
X!R`09.HEADER LEVEL 2 Modification History
X
X!R`09.BLANK.NO FILL
X!R`09EDIT`09EDIT DATE`09BY`09`09`09REASON
X!R`09----`09---------`09--`09`09`09------
X!`09
X!H`092 Modification
X!`09V01/01`09 6-FEB-1987`09WILTS`09`09`09-original release
X!`09V01/02`09 5-MAR-1987`09WILTS`09`09`09-allowed logical names for SYS$BATC
VH
X!`09V01/03`09 21-JUN-1988    WILTS`09`09`09-added /priority
X!R`09.FILL
X!FE
X!OS
X!R`09.HEADER LEVEL 2 Operation
X!H`092 Operation
X!`09`09This function can be called by any language.  it was designed
X!`09to be called by FORTRAN and is used to submit batch jobs. `20
X!`09FORMAT:`09ECS_SUBMIT (command_string, return_message, length_return_mess
Vage)
X!`09RETURNS:
X!`09`09VMS Usage:`09cond_value
X!`09`09type:`09`09longword (unsigned)
X!`09`09access:`09`09write only
X!`09`09mechanism:`09by value
X!
X!`09ARGUMENTS:
X!`09`09command_string
X!`09`09VMS Usage:`09char_string
X!`09`09type:`09`09character string
X!`09`09access:`09`09read only
X!`09`09mechanism:`09by descriptor
X!`09`09This variable is used to pass the entire submit command string
X!`09`09including the filename.
X!`09`09`09eg.  SUBMIT/AFTER=TOMORROW/QUEU=BIGJOB LOGIN.COM
X!
X!`09`09return_message
X!`09`09VMS Usage:`09char_string
X!`09`09type:`09`09character string
X!`09`09access:`09`09modify
X!`09`09mechanism:`09by descriptor
X!`09`09This variable  is used to return the job status messsage
X!
X!`09`09length_return_message
X!`09`09VMS Usage:`09word_unsigned
X!`09`09type:`09`09word (unsigned)
X!`09`09access:`09`09modify
X!`09`09mechanism:`09by descriptor
X!`09`09This variable will contain the length of return_message
X!OE
X
X!CS
X!`09.NO FILL
X!R`09.HEADER LEVEL 2 Logicals Accessed
X!H`092 Logicals _Accessed
X
X!`09None
X
X!
X!R`09.HEADER LEVEL 2 Return codes
X!H`092 Return codes
X
X!`09Many system service type return codes
X
X!R`09.FILL
X!CE
X
X! --------------------------------------------------------------------
X
X`09INTEGER*4 FUNCTION ECS_SUBMIT (`09COMMAND_LINE,`20
X`091`09`09`09`09JOB_STATUS_OUTPUT,
X`091`09`09`09`09LEN_JOB_STATUS)
X`09
X`09INTEGER*4`09STATUS,
X`091`09`09PRIORITY
X
X `09INTEGER*4`09SYS$SNDJBCW,
X`091`09`09SYS$BINTIM,`20
X`091`09`09CLI$DCL_PARSE,
X`091`09`09CLI$GET_VALUE,
X`091`09`09LIB$GET_INPUT,
X`091`09`09AFTER_TIME(2),
X`091`09`09CLI$PRESENT,
X`091`09`09LIB$FIND_FILE,
X`091`09`09LIB$FIND_FILE_END,
X`091`09`09CONTEXT,
X`091`09`09STR$TRIM,
X`091`09`09OTS$CVT_TU_L
X
X`09INTEGER*2`09I,
X`091`09`09LEN_LOG_QUEUE,
X`091`09`09LEN_BATCH_QUEUE,
X`091`09`09LEN_FILE_SPEC,
X`091`09`09LEN_LOG_SPEC,
X`091`09`09LEN_USERNAME,
X`091`09`09PARLENGTH,
X`091`09`09LEN_JOB_NAME,
X`091`09`09LEN_JOB_STATUS,
X`091`09`09LEN_AFTER_TIME,
X`091`09`09LEN_PRIORITY
X
X`09EXTERNAL`09BATCH_SUBMIT,
X`091`09`09LIB$SIG_TO_RET,
X`091`09`09CLI$_NEGATED
X
X`09INCLUDE`09`09'($SJCDEF)'
X`09INCLUDE`09`09'($SSDEF)'
X
X`09STRUCTURE`09/ITMLST/
X`09  UNION
X`09`09MAP
X`09`09`09INTEGER*2`09BUFLEN, ITMCOD
X`09`09`09INTEGER*4`09BUFADR, RETADR
X`09`09END MAP
X`09`09MAP
X`09`09`09INTEGER*4`09END_LIST
X`09`09END MAP
X`09  END UNION
X`09END STRUCTURE
X
X`09STRUCTURE`09/IOSBLK/
X`09`09`09INTEGER*4`09STS, ZEROED
X`09END STRUCTURE
X
X`09RECORD`09`09/ITMLST/ SUBMIT_LIST(25)
X`09RECORD`09`09/IOSBLK/ IOSB
X
X`09CHARACTER*(*)`09COMMAND_LINE
X`09CHARACTER*(*)`09JOB_STATUS_OUTPUT
X
X`09CHARACTER*255`09FILE_SPECIFICATION
X`09CHARACTER*31`09BATCH_QUEUE
X`09CHARACTER*31`09LOG_QUEUE
X`09CHARACTER*255`09LOG_SPECIFICATION`09`09/' '/
X`09CHARACTER*255`09USERNAME`09`09`09/' '/
X`09CHARACTER*255`09PARVALUE`09`09`09/' '/
X`09CHARACTER*255`09PARAMETERS(8)
X`09CHARACTER*255`09JOB_NAME    `09`09`09/' '/
X`09CHARACTER*255`09AFTER_TIME_STRING
X`09CHARACTER*8`09PRIORITY_STRING
X
X!
X`09BATCH_QUEUE = 'SYS$BATCH'
X`09LOG_QUEUE = 'SYS$PRINT'
X`09ECS_SUBMIT = SS$_NORMAL
X
X!
X! Initialize item list for the enter file specification
X!
X
X! /AFTER
X
X`09SUBMIT_LIST(1).BUFLEN = 8
X`09SUBMIT_LIST(1).ITMCOD = SJC$_NO_AFTER_TIME
X`09SUBMIT_LIST(1).BUFADR = %LOC(AFTER_TIME)
X`09SUBMIT_LIST(1).RETADR = 0
X
X! /DELETE
X
X`09SUBMIT_LIST(2).BUFLEN = 0
X`09SUBMIT_LIST(2).ITMCOD = SJC$_NO_DELETE_FILE
X`09SUBMIT_LIST(2).BUFADR = 0
X`09SUBMIT_LIST(2).RETADR = 0
X
X! JOB_STATUS_OUTPUT`09(RETURN VARIABLE)
X
X`09SUBMIT_LIST(3).BUFLEN = 255
X`09SUBMIT_LIST(3).ITMCOD = SJC$_JOB_STATUS_OUTPUT
X`09SUBMIT_LIST(3).BUFADR = %LOC(JOB_STATUS_OUTPUT)
X`09SUBMIT_LIST(3).RETADR = %LOC(LEN_JOB_STATUS)
X
X! /KEEP
X
X`09SUBMIT_LIST(4).BUFLEN = 0
X`09SUBMIT_LIST(4).ITMCOD = SJC$_NO_LOG_DELETE
X`09SUBMIT_LIST(4).BUFADR = 0
X`09SUBMIT_LIST(4).RETADR = 0
X
X! /NOTIFY
X
X`09SUBMIT_LIST(5).BUFLEN = 0
X`09SUBMIT_LIST(5).ITMCOD = SJC$_NOTIFY
X`09SUBMIT_LIST(5).BUFADR = 0
X`09SUBMIT_LIST(5).RETADR = 0
X
X! /PARAMETER 1
X
X`09SUBMIT_LIST(6).BUFLEN = 0
X`09SUBMIT_LIST(6).ITMCOD = SJC$_PARAMETER_1
X`09SUBMIT_LIST(6).BUFADR = %LOC(PARAMETERS(1))
X`09SUBMIT_LIST(6).RETADR = 0
X
X! /PARAMETER 2
X
X`09SUBMIT_LIST(7).BUFLEN = 0
X`09SUBMIT_LIST(7).ITMCOD = SJC$_PARAMETER_2
X`09SUBMIT_LIST(7).BUFADR = %LOC(PARAMETERS(2))
X`09SUBMIT_LIST(7).RETADR = 0
X
X! /PARAMETER 3
X
X`09SUBMIT_LIST(8).BUFLEN = 0
X`09SUBMIT_LIST(8).ITMCOD = SJC$_PARAMETER_3
X`09SUBMIT_LIST(8).BUFADR = %LOC(PARAMETERS(3))
X`09SUBMIT_LIST(8).RETADR = 0
X
X! /PARAMETER 4
X
X`09SUBMIT_LIST(9).BUFLEN = 0
X`09SUBMIT_LIST(9).ITMCOD = SJC$_PARAMETER_4
X`09SUBMIT_LIST(9).BUFADR = %LOC(PARAMETERS(4))
X`09SUBMIT_LIST(9).RETADR = 0
X
X! /PARAMETER 5
X
X`09SUBMIT_LIST(10).BUFLEN = 0
X`09SUBMIT_LIST(10).ITMCOD = SJC$_PARAMETER_5
X`09SUBMIT_LIST(10).BUFADR = %LOC(PARAMETERS(5))
X`09SUBMIT_LIST(10).RETADR = 0
X
X! /PARAMETER 6
X
X`09SUBMIT_LIST(11).BUFLEN = 0
X`09SUBMIT_LIST(11).ITMCOD = SJC$_PARAMETER_6
X`09SUBMIT_LIST(11).BUFADR = %LOC(PARAMETERS(6))
X`09SUBMIT_LIST(11).RETADR = 0
X
X! /PARAMETER 7
X
X`09SUBMIT_LIST(12).BUFLEN = 0
X`09SUBMIT_LIST(12).ITMCOD = SJC$_PARAMETER_7
X`09SUBMIT_LIST(12).BUFADR = %LOC(PARAMETERS(7))
X`09SUBMIT_LIST(12).RETADR = 0
X
X! /PARAMETER 8
X
X`09SUBMIT_LIST(13).BUFLEN = 0
X`09SUBMIT_LIST(13).ITMCOD = SJC$_PARAMETER_8
X`09SUBMIT_LIST(13).BUFADR = %LOC(PARAMETERS(8))
X`09SUBMIT_LIST(13).RETADR = 0
X
X! /PRINTER
X
X`09SUBMIT_LIST(14).BUFLEN = 0
X`09SUBMIT_LIST(14).ITMCOD = SJC$_LOG_SPOOL
X`09SUBMIT_LIST(14).BUFADR = 0
X`09SUBMIT_LIST(14).RETADR = 0
X
X! /QUEUE=
X`09STATUS = STR$TRIM(BATCH_QUEUE,BATCH_QUEUE,LEN_BATCH_QUEUE)
X`09SUBMIT_LIST(15).BUFLEN = LEN_BATCH_QUEUE
X`09SUBMIT_LIST(15).ITMCOD = SJC$_QUEUE
X`09SUBMIT_LIST(15).BUFADR = %LOC(BATCH_QUEUE)
X`09SUBMIT_LIST(15).RETADR = 0
X
X! /RESTART
X
X`09SUBMIT_LIST(16).BUFLEN = 0
X`09SUBMIT_LIST(16).ITMCOD = SJC$_RESTART
X`09SUBMIT_LIST(16).BUFADR = 0
X`09SUBMIT_LIST(16).RETADR = 0
X
X! FILE SPECIFICATION
X
X`09SUBMIT_LIST(17).BUFLEN = 255
X`09SUBMIT_LIST(17).ITMCOD = SJC$_FILE_SPECIFICATION
X`09SUBMIT_LIST(17).BUFADR = %LOC(FILE_SPECIFICATION)
X
X! Other optional Submission qualifiers
X
X`09SUBMIT_LIST(18).END_LIST = 0
X`09SUBMIT_LIST(19).END_LIST = 0
X`09SUBMIT_LIST(20).END_LIST = 0
X`09SUBMIT_LIST(21).END_LIST = 0
X`09SUBMIT_LIST(22).END_LIST = 0
X`09SUBMIT_LIST(23).END_LIST = 0
X`09SUBMIT_LIST(24).END_LIST = 0
X`09SUBMIT_LIST(25).END_LIST = 0
X
X!
X! MAIN ROUTINE HERE:
X!
X!`09STATUS = LIB$GET_INPUT ( COMMAND_LINE, 'SUBMIT> ',)
X!
X! DON'T WANT WARNING MESSAGES FROM CLI$DCL_PARSE.  ESTABLISH CONDITION HANDL
VER
X! THIS MERELY TELLS THE PARSER NOT TO SIGNAL MESSAGE BUT TO STILL RETURN THE
X! STATUS CODE SO I CAN TEST IT AND PUKE IN THE CALLER'S FACE IF NEED BE.
X!
X`09CALL LIB$ESTABLISH (LIB$SIG_TO_RET)
X!
X! PARSE THE COMMAND FOR VALIDITY
X!
X`09STATUS = CLI$DCL_PARSE( COMMAND_LINE, BATCH_SUBMIT,,,)
X!
X! CANCEL CONDITION HANDLER AND HANDLE ALL MESSAGES NORMALLY
X!
X`09CALL LIB$REVERT
X!
X! RETURN IF AN ERROR IN CLI$DCL_PARSE
X!
X`09IF (.NOT. STATUS) THEN
X`09`09ECS_SUBMIT = STATUS
X`09`09RETURN
X`09ENDIF
X
X! START PARSING THE PIECES OF THE COMMAND
X
X`09IF (CLI$PRESENT('AFTER')) THEN
X`09`09STATUS = CLI$GET_VALUE ('AFTER',AFTER_TIME_STRING,LEN_AFTER_TIME)
X`09`09IF (.NOT. STATUS) THEN
X`09`09`09ECS_SUBMIT = STATUS
X`09`09`09RETURN
X`09`09ENDIF
X`09`09STATUS = SYS$BINTIM (AFTER_TIME_STRING,AFTER_TIME)
X`09`09IF (.NOT. STATUS) THEN
X`09`09`09ECS_SUBMIT = STATUS
X`09`09`09RETURN
X`09`09ENDIF
X`09`09SUBMIT_LIST(1).BUFLEN = 8
X`09`09SUBMIT_LIST(1).ITMCOD = SJC$_AFTER_TIME
X`09ENDIF
X
X`09IF (CLI$PRESENT ('DELETE')) THEN
X`09`09SUBMIT_LIST(2).ITMCOD = SJC$_DELETE_FILE
X`09ENDIF
X
X`09IF (CLI$PRESENT ('KEEP') .EQ. %LOC(CLI$_NEGATED)) THEN
X`09`09SUBMIT_LIST(4).ITMCOD = SJC$_LOG_DELETE
X`09ENDIF
X`09`09
X`09IF (CLI$PRESENT ('NOTIFY') .EQ. %LOC(CLI$_NEGATED)) THEN
X`09`09SUBMIT_LIST(5).ITMCOD = SJC$_NO_NOTIFY
X`09ENDIF
X
X`09I = 5
X`09IF (CLI$PRESENT ('PARAMETERS')) THEN
X`09`09STATUS = CLI$GET_VALUE ('PARAMETERS', PARVALUE, PARLENGTH)
X`09`09DO WHILE (STATUS)
X`09`09`09I = I + 1
X`09`09`09SUBMIT_LIST(I).BUFLEN = PARLENGTH
X`09`09`09PARAMETERS(I-5) = PARVALUE
X`09`09`09STATUS = CLI$GET_VALUE ('PARAMETERS', PARVALUE, PARLENGTH)
X`09`09ENDDO`20
X`09ENDIF
X
X`09
X`09IF (CLI$PRESENT ('QUEUE')) THEN
X`09`09STATUS = CLI$GET_VALUE ('QUEUE',BATCH_QUEUE,LEN_BATCH_QUEUE)
X`09`09SUBMIT_LIST(15).BUFLEN = LEN_BATCH_QUEUE
X`09ENDIF
X
X`09IF (CLI$PRESENT ('RESTART') .EQ. %LOC(CLI$_NEGATED)) THEN
X`09`09SUBMIT_LIST(16).ITMCOD = SJC$_NO_RESTART
X`09ENDIF
X
X!`09Don't care about return code for LIB$FIND_FILE.  This will be handled
X!`09by the call to SNDJBC which will return the error codes.  The call here
X!`09is for parsing the .COM to the end only.
X
X`09STATUS = CLI$GET_VALUE ('FILESPEC',FILE_SPECIFICATION,LEN_FILE_SPEC)
X`09`09STATUS = LIB$FIND_FILE ( FILE_SPECIFICATION, FILE_SPECIFICATION,
X`091`09`09CONTEXT, '.COM',,,)
X`09`09SUBMIT_LIST(17).BUFLEN = 255
X`09`09STATUS = LIB$FIND_FILE_END (CONTEXT)
X`09
X`09I = 17
X
X`09IF (CLI$PRESENT ('LOG_FILE') .EQ. %LOC(CLI$_NEGATED)) THEN
X`09`09SUBMIT_LIST(14).ITMCOD = SJC$_NO_LOG_SPOOL
X`09`09I = I + 1
X`09`09SUBMIT_LIST(I).BUFLEN = 0
X`09`09SUBMIT_LIST(I).ITMCOD = SJC$_NO_LOG_SPECIFICATION
X`09`09SUBMIT_LIST(I).BUFADR = 0
X`09`09SUBMIT_LIST(I).RETADR = 0
X`09ENDIF
X
X`09IF (CLI$PRESENT ('LOG_FILE')) THEN
X`09`09I = I + 1
X`09`09STATUS = CLI$GET_VALUE ('LOG_FILE',LOG_SPECIFICATION,
X`091`09`09LEN_LOG_SPEC)
X`09`09SUBMIT_LIST(I).BUFLEN = LEN_LOG_SPEC
X`09`09SUBMIT_LIST(I).ITMCOD = SJC$_LOG_SPECIFICATION
X`09`09SUBMIT_LIST(I).BUFADR = %LOC(LOG_SPECIFICATION)
X`09`09SUBMIT_LIST(I).RETADR = 0
X`09ENDIF
X
X`09IF (CLI$PRESENT ('USER')) THEN
X`09`09I = I + 1
X`09`09STATUS = CLI$GET_VALUE ('USER',USERNAME,LEN_USERNAME)
X`09`09SUBMIT_LIST(I).BUFLEN = LEN_USERNAME
X`09`09SUBMIT_LIST(I).ITMCOD = SJC$_USERNAME
X`09`09SUBMIT_LIST(I).BUFADR = %LOC(USERNAME)
X`09`09SUBMIT_LIST(I).RETADR = 0
X`09ENDIF
X
X`09IF (CLI$PRESENT ('HOLD')) THEN
X`09`09I = I + 1
X`09`09SUBMIT_LIST(I).BUFLEN = 0
X`09`09SUBMIT_LIST(I).ITMCOD = SJC$_HOLD
X`09`09SUBMIT_LIST(I).BUFADR = 0
X`09`09SUBMIT_LIST(I).RETADR = 0
X`09ENDIF
X
X`09IF (CLI$PRESENT ('NAME')) THEN
X`09`09I = I + 1
X`09`09STATUS = CLI$GET_VALUE ('NAME',JOB_NAME,LEN_JOB_NAME)
X`09`09SUBMIT_LIST(I).BUFLEN = LEN_JOB_NAME
X`09`09SUBMIT_LIST(I).ITMCOD = SJC$_JOB_NAME
X`09`09SUBMIT_LIST(I).BUFADR = %LOC(JOB_NAME)
X`09`09SUBMIT_LIST(I).RETADR = 0
X`09ENDIF
X`09
X`09IF (CLI$PRESENT ('PRINTER') .EQ. %LOC(CLI$_NEGATED)) THEN
X`09`09SUBMIT_LIST(14).ITMCOD = SJC$_NO_LOG_SPOOL
X`09ENDIF
X
X`09IF (CLI$PRESENT ('PRINTER')) THEN
X`09`09I = I + 1
X`09`09STATUS = CLI$GET_VALUE ('PRINTER',LOG_QUEUE,LEN_LOG_QUEUE)
X`09`09SUBMIT_LIST(I).BUFLEN = LEN_LOG_QUEUE
X`09`09SUBMIT_LIST(I).ITMCOD = SJC$_LOG_QUEUE
X`09`09SUBMIT_LIST(I).BUFADR = %LOC(LOG_QUEUE)
X`09`09SUBMIT_LIST(I).RETADR = 0
X`09ENDIF
X
X`09IF (CLI$PRESENT ('PRIORITY')) THEN
X`09`09I = I + 1
X`09`09STATUS = CLI$GET_VALUE ('PRIORITY',PRIORITY_STRING,LEN_PRIORITY)
X`09`09STATUS = OTS$CVT_TU_L (PRIORITY_STRING(1:LEN_PRIORITY),PRIORITY,)
X`09`09IF (.NOT. STATUS) THEN
X`09`09`09ECS_SUBMIT = STATUS
X`09`09`09RETURN
X`09`09ENDIF
X`09`09SUBMIT_LIST(I).BUFLEN = 4
X`09`09SUBMIT_LIST(I).ITMCOD = SJC$_PRIORITY
X`09`09SUBMIT_LIST(I).BUFADR = %LOC(PRIORITY)
X`09`09SUBMIT_LIST(I).RETADR = 0
X`09ENDIF
X
X`09STATUS = SYS$SNDJBCW ( ,
X`091`09`09%VAL(SJC$_ENTER_FILE),,
X`092`09`09SUBMIT_LIST,
X`093`09`09IOSB,,)
X
X`09IF (STATUS) STATUS = IOSB.STS
X`09IF (.NOT. STATUS) THEN
X`09`09ECS_SUBMIT = STATUS
X`09`09RETURN
X`09ENDIF
X
X`09RETURN
X`09END
$ CALL UNPACK ECS_SUBMIT.FOR;11 475349145
$ create 'f'
XMODULE BATCH_SUBMIT
X`09DEFINE VERB SUBMIT
X`09`09PARAMETER P1, VALUE(TYPE=$FILE),LABEL=FILESPEC
X`09`09QUALIFIER AFTER, VALUE(REQUIRED,TYPE=$DATETIME),NONNEGATABLE
X`09`09QUALIFIER DELETE
X`09`09QUALIFIER HOLD
X`09`09QUALIFIER KEEP, DEFAULT
X`09`09QUALIFIER LOG_FILE, VALUE(TYPE=$FILE)
X`09`09QUALIFIER NAME, VALUE(REQUIRED)
X`09`09QUALIFIER NOTIFY, DEFAULT
X`09`09QUALIFIER PARAMETERS, VALUE(REQUIRED,LIST),NONNEGATABLE
X`09`09QUALIFIER PRINTER, VALUE(DEFAULT=SYS$PRINT)
X`09`09QUALIFIER PRIORITY, VALUE(TYPE=$NUMBER)
X`09`09QUALIFIER QUEUE,VALUE(DEFAULT=SYS$BATCH),NONNEGATABLE
X`09`09QUALIFIER RESTART, DEFAULT
X`09`09QUALIFIER USER, VALUE(REQUIRED),NONNEGATABLE
$ CALL UNPACK SUBMIT.CLD;8 1846769585
$ v=f$verify(v)
$ EXIT


