1752716 Members
5437 Online
108789 Solutions
New Discussion юеВ

Server Que

 
SOLVED
Go to solution
Joseph Drozdz
Advisor

Server Que

Is there a way that I can set up a server que
to print to two different printers? Presntly our programs print only to one printer, but we would like the same job to print to two different printers. Thanks Joe
23 REPLIES 23
Ian Miller.
Honored Contributor

Re: Server Que

do you mean one copy of each file submited with be printered on both of two printers?
____________________
Purely Personal Opinion
Joseph Drozdz
Advisor

Re: Server Que

Hello Ian

Yes, the exact same file that prints on one printer, should be the same file print on the other printer.
Uwe Zessin
Honored Contributor

Re: Server Que

Start a GOOGLE search for 'CTLSMB'. This is a server symbiont (written in Fortran), that starts a DCL subprocess for each entry. I have used it in the past to:

- send output to two different queues (one local, the other was a DQS queue for printing in a different location)

- adapt output that I have received from a IBM host via SNA/PRE (printer emulator) to send it to a laser printer.
.
Bojan Nemec
Honored Contributor
Solution

Re: Server Que

Joe,

How are the jobs queued? With the PRINT command, with the SYS$SENDJBC system service, with opening a spooled device or something other?

Bojan
Joseph Drozdz
Advisor

Re: Server Que

Hi Bojan

The job is currently qued with the PRINT command. Print/que=XXX.
Lokesh_2
Esteemed Contributor

Re: Server Que

If your program is a command procedure, then why not you modify it with another print command next to your existing one to print to another printer ? This may be the easiest solution.

HTH,
Thanks & regards,
Lokesh
What would you do with your life if you knew you could not fail?
Bojan Nemec
Honored Contributor

Re: Server Que

Joe,

If you want a transparent way to yours problem, try to implement CTLSMB as mentioned by Uwe. With CTLSMB you will have a queue which works with all methods for submitting print jobs.
You can write your own print symbiont. (The hardest way).

If you want a simplier way, you can write a simple command procedure which will substitute the print command. I give you a sample, which is not perfect but working:

$ double=0
$ a=1
$l:
$ qual = p'a'
$ if f$extract(0,4,qual).eqs."/QUE"
$ then
$ que = f$element(1,"=",qual)
$ if que.eqs."DOUBLE"
$ then
$ double=1
$ p'a'=""
$ endif
$ endif
$ show symbol /all
$ a=a+1
$ if a.lt.9 then goto l
$ oldprint=print
$ print=="PRINT"
$ if double
$ then
$ print /queue=q1 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8'
$ print /queue=q2 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8'
$ else
$ print 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8'
$ endif
$ print==oldprint


You must define a symbol like this:

$ PRINT == "@dev:[dir]PRINT.COM X"

The X at the end is a dummy parameter to allow to have a qualifier as first parameter (Not allowed by command procedures).

Bojan
John Gillings
Honored Contributor

Re: Server Que

Bojan,

Regarding your code:

>$ oldprint=print
>$ print=="PRINT"
>...
>$ print whatever
>...
>$ print==oldprint

You can replace this with

$ printxx whatever

The additional "xx" will bypass symbol lookup, and since DCL doesn't look past the first 4 characters, it will invoke the real "PRINT" command. Purists will tell you that's not strictly supported, which is true (but I doubt very much it will ever break).

If you want fully supported, go with:

$ SET SYMBOL/SCOPE=(NOLOCAL,NOGLOBAL)

This will prevent the translation of global symbols and local symbols from higher level procedures while executing your procedure.

Note that your existing code will break symbol contraction. Consider:

$ PR*INT=="@dev:[dir]PRINT.COM X"

this will allow the verb "PRINT" to be contracted down to PR (just like the real command), but after your code executes, the ability to contract will be lost.
A crucible of informative mistakes
Bojan Nemec
Honored Contributor

Re: Server Que

John,

Thank you for your hint. The printxx reduces the procedure for some error handling (in my procedure if you get an error in the real print command you lose the print symbol). The procedure I posted is far away from perfection. There is much to do abbout qualifier recognition ( print /copy=3/queue=double or print /queue=double/copy=3 will not work properly because there is no space between qualifiers). Maybe a new lexical function, say f$dclparse, will be great for such procedures.
I also noted that there is an extra line in my code ($ show symbol /all) this was only for debuging purpouses.

Bojan