Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!rutgers!clyde!burl!codas!mtune!icus!gil
From: gil@icus.UUCP (Gil Kloepfer Jr.)
Newsgroups: comp.os.vms
Subject: Re: Printing from inside a program.
Message-ID: <158@icus.UUCP>
Date: Sat, 5-Dec-87 05:35:25 EST
Article-I.D.: icus.158
Posted: Sat Dec  5 05:35:25 1987
Date-Received: Fri, 11-Dec-87 06:48:28 EST
References: <12355095965.50.JDM@XX.LCS.MIT.EDU>
Sender: gil@icus.UUCP
Reply-To: gil@icus.UUCP (Gil Kloepfer Jr.)
Organization: Bowne Management Systems, Mineola, NY
Lines: 51
Summary: Here's the simplest way to do it...
To: gil@icus.UUCP


In article <12355095965.50.JDM@XX.LCS.MIT.EDU> JDM@XX.LCS.MIT.EDU (Joshua D. Marantz) writes:
>I would like to spool a file to SYS$PRINT or another print spooler from
>a program.  I know I could lib$spawn a print command, and look at the
>termination status, but I was hoping for a cleaner, faster way.  Any
>ideas?
>
>-Joshua D. Marantz
>Viewlogic Systems, Inc.
>-------

Summary of different fixes follow...


carl@CITHEX.CALTECH.EDU (Carl J Lydick) writes:

>If, when you open the file, you set the bit FAB$V_SPL in the FAB$L_FOP field,
>the file will be spooled to SYS$PRINT on CLOSE.


NEWCOMER@DICKINSN.BITNET ("Newcomer, Don") writes:

>Use the SYS$SNDJBC call.  It does the trick quite nicely!

-----

The former basically says what I am about to say in FORTRAN rather than RMS:

	OPEN(UNIT=unit#,FILE='banner-name',
             STATUS='NEW',DISP='PRINT/DELETE')

(I always get the STATUS and DISP keywords reversed...if they're backwards,
 I automatically admit I was wrong and no flames please! :-)

This will send all output to unit# to the specified file (I called it
banner-name since it will also be the name on the banner which is sometimes
displayed at the beginning of a print job) and will spool the file for
printing when closed.  I would imagine for other languages, if there isn't
a DEC enhancement (like in FORTRAN) which allows you to do this, then you
would mess with the bits in the FAB when you open the file (would be pretty
hard for most of us).

I don't know too much about the second idea...  I would look into that one,
but the above is so much easier to understand...

Hope this helps.

===============================================================================
Gil Kloepfer, Jr.                               ...ihnp4!icus!gil
Senior Programmer                                (or whatever path works best
Bowne Management Systems, Inc.                    on the day you reply!)
Mineola, NY    (516) 248-6840   ext 796
===============================================================================