Everhart, Glenn
From:	David L. Cathey [davidc@Montagar.com]
Sent:	Wednesday, March 10, 1999 11:32 AM
To:	Info-VAX@Mvb.Saic.Com
Subject:	Re: System Service call to put item into print a print queue.
Greg Thomas wrote:
> Thanks for the info, you did guess correctly ...

	This can also be done with the $SNDJBC System Service to
a user-specified queue...  Or given that the System Service doess't
care if it's a batch queue, you could submit a batch job, too.

#include        <ssdef.h>
#include        <sjcdef.h>

submit_file(file, queue)
char	*file ;
char	*queue ;
{
        int     iosb[2] ;
        int     status ;
        struct item_list {
                short   buflen ;
                short   code ;
                char    *bufadr ;
                short   *retlen ;
        } itmlst[10] ;

        itmlst[0].buflen = strlen(queue) ;
        itmlst[0].code = SJC$_QUEUE ;
        itmlst[0].bufadr = queue ;
        itmlst[0].retlen = NULL ;
        itmlst[1].buflen = strlen(file) ;
        itmlst[1].code = SJC$_FILE_SPECIFICATION ;
        itmlst[1].bufadr = file ;
        itmlst[1].retlen = NULL ;

        itmlst[2].buflen = 0 ;
        itmlst[2].code = 0 ;
        itmlst[2].bufadr = NULL ;
        itmlst[2].retlen = NULL ;

        status = SYS$SNDJBCW(0, SJC$_ENTER_FILE, 0, itmlst, iosb, 0, 0)
;
        if(status & 1)
                status = iosb[0] ;
        return(status) ;
}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David L. Cathey                      |Inet: davidc@montagar.com
Montagar Software Concepts           |Fone: (972)-578-5036
P. O. Box 260772, Plano, TX 75026    |http://www.montagar.com
Postmaster, Hostmaster, Webmaster    |http://www.whiteice.com