From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 16-APR-1991 08:11:37.64
To:	ARISIA::EVERHART
CC:	
Subj:	Re: SNDJBC examples wanted

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

Received:  by crdgw1.ge.com (5.57/GE 1.97)
	 id AA29435; Tue, 16 Apr 91 07:42:54 EDT
Received: From DANPOST.UNI-C.DK by CRVAX.SRI.COM with TCP; Tue, 16 APR 91 04:29:09 PST
Received: from vms2.uni-c.dk by danpost.uni-c.dk (5.65/1.34)
	id AA14098; Tue, 16 Apr 91 11:25:57 GMT
Date: Tue, 16 Apr 91 13:28 +0200
From: ISIS08@ecostat.aau.dk
Subject: Re: SNDJBC examples wanted
To: STEVENS@RAD.HUP.UPENN.EDU, INFO-VAX@SRI.COM
Message-Id: <8C888EB6D55F0012B3@vms2.uni-c.dk>
X-Envelope-To: STEVENS@RAD.HUP.UPENN.EDU, INFO-VAX@SRI.COM
X-Vms-To: UNIL63::IN%"STEVENS@RAD.HUP.UPENN.EDU"
X-Vms-Cc: IN::"INFO-VAX@SRI.COM"

>I'm looking for examples of code using the SNDJBC system service.
>Macro, FORTRAN, or C will do nicely.
>
>The problem is that I'd like to have a process submit a job
>to a batch que.  Normally I'd spawn a subprocess to do the submit,
>but unfortunately this time I have to do it from a detached process.
>So I can't spawn a subprocess.  Hence this request.

The following small MACRO routine submits a batchjob:

        .title  submit
        $SJCDEF
        .psect  $PDATA long,pic,con,lcl,shr,noexe,nowrt
argl_sndjbc:
        .long   7
        .long   0                       ; efn
        .long   SJC$_ENTER_FILE         ; function
        .long   0
        .address quecmd                 ; item-list
        .long   0                       ; iosb
        .long   0                       ; ast-address
        .long   0                       ; ast-parameter
cpulim: .long   360000
        .psect  $LOCAL long,pic,con,lcl,noshr,noexe,wrt
quecmd: .blkw   1
        .word   SJC$_QUEUE
        .blkl   1
        .long   0
        .blkw   1
        .word   SJC$_FILE_SPECIFICATION
        .blkl   1
        .long   0
        .word   4
        .word   SJC$_CPU_LIMIT          ; /CPU=1:00:00
        .address cpulim
        .long   0
        .word   0
        .word   SJC$_NO_LOG_SPOOL       ; /NOPRINT
        .long   0
        .long   0
        .word   0
        .word   SJC$_NOTIFY             ; /NOTIFY
        .long   0
        .long   0
        .long   0
        .psect  $CODE long,pic,con,lcl,shr,exe,nowrt
;********************
;
;  SUBMIT ( QNM , FNM )
;
;  submit file
;
;********************
        .entry  submit,^m<iv>
        movl    B^4(ap),r0
        movw    (r0),quecmd
        movl    B^4(r0),quecmd+4
        movl    B^8(ap),r1
        movw    (r1),quecmd+12
        movl    B^4(r1),quecmd+16
        callg   argl_sndjbc,G^SYS$SNDJBCW
        ret
        .end

It should be easy to modify with the specific SUBMIT qualifiers you
want.

                                                                Arne

Arne Vajhxj                             Internet: ISIS08@ECOSTAT.AAU.DK
Institute of Economics and Statistics   PSI:      DATAPAX.23830211371400::ISIS08
Aarhus University
Denmark


