HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

VMS Print Queues

 
PaulJ_2
Occasional Contributor

VMS Print Queues

I need to capture the print stream of a print job in a VMS queue. Ideally, I would like the job to go to the printer and a copy of the print stream go to a location on the system in a directory. Is it possible to capture the print stream, (actually data that is sent to the printer), from a VMS print queue?

Thank you
PaulJ
12 REPLIES
Robert Gezelter
Honored Contributor

Re: VMS Print Queues

PaulJ,

First, please allow me to welcome you the OpenVMS Forum!

There are several questions that are relevant:
- How is the data being written?
- Is the data being written to a spooled printer (e.g., LPT1:, TTxxx:, etc.)?
- Is the data being written to a file which is then spooled for printing?
(The above should be straightforward to determine from the queue entry, if is not clear, please cut out the appropriate section of the output from a $ SHOW QUEUE/PRINT/FULL and attach it to the posting.)

Depending on the answer to the above, there are a variety of different solutions.

- Bob Gezelter, http://www.rlgsc.com
PaulJ_2
Occasional Contributor

Re: VMS Print Queues

-The data is being written by a cobol program using a PRINTER SELECT definition

-I believe it is a spooled printer

-I do not have a queue entry example, but here is the show queue


BLVA> show queue/full FMSDEN2
Printer queue FMSDEN2, idle, on BLVA::NLP46:, mounted form UHAWB
<7.231.123.200:8002 - IP chgd 3/27/07>
/BASE_PRIORITY=4 /DEFAULT=(FORM=UHAWB) /NOENABLE_GENERIC Lowercase
/OWNER=[SYSTEM] /PROCESSOR=MULTINET_STREAM_SYMBIONT
/PROTECTION=(S:M,O:D,G:R,W:SM) /RETAIN=ERROR
BLVA>
David Jones_21
Trusted Contributor

Re: VMS Print Queues

As others here like to say, "What problem are you trying to solve"? Capturing data sent to the printer has different meanings depending upon whether you are trying to diagnose a printer problem versus making some kind of audit trail.

If you are trying to diagnose a problem and it is a network printer, you could possibly use TCPTRACE to capture the dialog.
I'm looking for marbles all day long.
PaulJ_2
Occasional Contributor

Re: VMS Print Queues

Sorry, new project to eliminate the printing of data on forms. We are using some 3rd party software to process the print stream and mary it with an image of the form in a PDF file. The PDF file would then be sent to a new laser printer. We have tried using the Flat Text file but the 3rd party software is having a problem with it. The 3rd party software needs the actual Print Stream that is sent to the printer. So, my questions is, how can I capture this Print Stream to use as an input file for the new process?

Thank you
PaulJ
PaulJ_2
Occasional Contributor

Re: VMS Print Queues

Sorry, new project to eliminate the printing of data on forms. We are using some 3rd party software to process the print stream and marry it with an image of the form in a PDF file. The PDF file would then be sent to a new laser printer. We have tried using the Flat Text file but the 3rd party software is having a problem with it. The 3rd party software needs the actual Print Stream that is sent to the printer. So, my questions is, how can I capture this Print Stream to use as an input file for the new process?

Thank you
PaulJ
Robert Gezelter
Honored Contributor

Re: VMS Print Queues

PaulJ,

Having been down this path more than a few times, there are more details needed.

To start:
- Which third-party package?
- Exactly what are the COBOL statements used to open the file? What logical names are defined at the time that the file is opened?

This problem could be as simple as a parameter setting or a small change to the source program. I have seen it in the past. Without the details however, it is not possible to say.

- Bob Gezelter, http://www.rlgsc.com
P.S. If there is a lack of comfort with posting the details publicly, I can be contacted offline, as can other active contributors to this forum.
Robert Gezelter
Honored Contributor

Re: VMS Print Queues

PaulJ,

re: the SHOW QUEUE output. The printer appears to be a network printer. However, such a printer could be used as either the target of a file, or transparently spooled.

The correct solution depends on the answer.

- Bob Gezelter, http://www.rlgsc.com
Hoff
Honored Contributor

Re: VMS Print Queues

My usual off-the-cuff answer for "I need a print symbiont to do..." questions...

http://mvb.saic.com/freeware/freewarev80/execsymb/

Or roll your own symbiont. That's fully supported, and there are various examples around. dbs-nullsymbiont is on the same Freeware, and there are examples in the manuals and around the freeware at mvb.saic.com.

Use the google Site:mvb.saic.com keyword to restrict your Google search to the Freeware archives, as that site has an archive far larger than any Freeware archive at HP.

John Gillings
Honored Contributor

Re: VMS Print Queues

PaulJ,

If you find the idea of writing a symbiont too daunting, you could also try STOPping the queue and examining the entries that your program submits to it. Depending on the mechanism, the entry may point to a file, which you can access directly or copy elsewhere for processing.

So a quick and dirty implementation would be to keep the queue stopped, scan it every so often for pending entries, copy or process the files pointed to by the entries, then delete the entries when completed.

An even dirtier mechanism would be to direct the printer to a serial port, loop it back to a second serial port and have a process reading and processing the data as it arrives.
A crucible of informative mistakes
Robert Gezelter
Honored Contributor

Re: VMS Print Queues

PaulJ,

Normally, I am in almost complete agreement with Hoff and John. Indeed, John's comment about "looping a serial port" back did occur to me. In this case, WADR, I must demurr.

While it is not a guarantee, it has generally been my experience that such measures are more drastic than what is needed in most situations, and give rise to more maintenance than is necessary. If we can look at the basics of what is actually happening (e.g., identify the actual source construct(s), the third party package, and some other details), there is a good chance that a very straightforward solution will present itself. I have seen issues as simple as a program's choice of file format. Insignificant to the program, and the print symbiont, but occasionally of great significance to some other tool.

- Bob Gezelter, http://www.rlgsc.com
Jess Goodman
Esteemed Contributor

Re: VMS Print Queues

There are a couple of possible reasons that your third party software can't directly process the "flat" file that gets printed.
The most likely ones are:

* The print form used by the print job has one or more /SETUP modules associated with it. If this is the case (check with SHOW ENTRY/FULL and then SHOW QUEUE/FORM/FULL) you can extract the module(s) from the text /LIBRARY associated with the queue (use SHOW QUEUE/FULL) using the DCL command $LIBRARY/EXTRACT=module/OUTPUT=file library and then insert the module(s) text at the head of the print file.

* The print file may be in a RMS record format that your third party software doesn't know how to process such as variable length records. You can check this with DIRECTORY/FULL. If so you can convert the file to stream records with:
$CONVERT oldfile newfile /FDL=SYS$INPUT:
RECORD
FORMAT STREAM
or your application might need STREAM_LF.
I have one, but it's personal.
Verne Britton
Regular Advisor

Re: VMS Print Queues

shameless plug ... see my DRAIN program on Freeware v7 and at

http://wvnvaxa.wvnet.edu/vmswww/drain.html

Warnings:

1) it was written for the Multinet TCP/IP stack

2) it was written with just plain text files in mind

--------------------------------------

BUT ... it could give you a starting point for what you need :-)

FYI, DRAIN captures a print stream and saves it to a file.

Good Luck !!


Verne Britton