1828026 Members
2261 Online
109973 Solutions
New Discussion

Re: 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
Uwe Zessin
Honored Contributor

Re: Server Que

See if you can get hold of the old VMSTAILOR DCL procedure (VMS V4.x). It provided a user interface that did DCL-style parsing.
.
Wim Van den Wyngaert
Honored Contributor

Re: Server Que

Even better would be :
print/que=(prt1,prt2,prt3)

But if they are not of the same type, you may run in into /form handling problems.

Wim
Wim
Willem Grooters
Honored Contributor

Re: Server Que

Joseph,

Are those multiple printers of the same type? If so, it might be feasable to create an execution queue for each of them, and one generic queue to print on all of these printers. This queue is to be used by your application.

$ INIT/QUEUE/.... printer1
$ INIT/QUEUE/.... printer2
$ INIT/QUEUE/.... printer3
$ INIT/QUEUE/GENERIC=(Printer1, printer2, printer3).... printqueue

And your programs shoud use:

PRINT /QUEUE=printqueue

Willem
Willem Grooters
OpenVMS Developer & System Manager
Wim Van den Wyngaert
Honored Contributor

Re: Server Que

Uwe Zessin
Honored Contributor

Re: Server Que

Willem,
the challenge is to send the same output to two different printers at the same time, not to send output once to any set of printers.
.
Antoniov.
Honored Contributor

Re: Server Que

Hi Joseph,
if you redefine print command ad DCL level remember you can't type
PRINT /QUE=MyQue MyFile
because DCL command can't start with qualifier.
You must always type
PRINT MyFile /QUE=MyQue

Antonio Vigliotti
Antonio Maria Vigliotti
Uwe Zessin
Honored Contributor

Re: Server Que

Interesting system...

$ print/queue=TCPIP$LPD_IN_ATHENA_1 sys$login:login.com
Job LOGIN (queue TCPIP$LPD_IN_ATHENA_1, entry 1) pending
pending status caused by queue stopped state
$ write sys$output f$getsyi("version")
V7.3-1
$
.
Antoniov.
Honored Contributor

Re: Server Que

Uwe,
before submition, que was in idle state, isn't true?

Antonio Vigliotti
Antonio Maria Vigliotti
Uwe Zessin
Honored Contributor

Re: Server Que

Hello Antonio,
the queue was stopped, because I didn't want any output. But upon re-reading your message I think I might have misunderstood you anyway - did you mean this?

$ set prompt="$$ "
$$ prt == "@PRT"
$$ prt /queue=TCPIP$LPD_IN_ATHENA_1 login.com
%DCL-W-IVQUAL, unrecognized qualifier - check validity, spelling, and placement
$$ prt "/queue=TCPIP$LPD_IN_ATHENA_1 login.com
Job LOGIN (queue TCPIP$LPD_IN_ATHENA_1, entry 2) pending
pending status caused by queue stopped state
$$ type prt.com
$ print/notify 'P1'
$ exit
$$
.
Bojan Nemec
Honored Contributor

Re: Server Que

Hi antonio,Uwe,

If you look at my first post in this thread I suggest that Joseph define a symbol like:

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

The X at the end is a dummy parameter which will solve the problem which was mentioned by Antonio. So Uwes prt.com will look something like this:
$ print/notify 'P2'
$ exit

Looking at Uwe test I realised that maybe something like this will also work (but i must test this and no VMS handy):
$ PRINT == "@dev:[dir]PRINT.COM"""

Bojan
Uwe Zessin
Honored Contributor

Re: Server Que

Yes, I know. I was trying to understand Antonio's response.

Here is the result from your suggestion:
$$ type prt.com
$ print/notify 'P1'
$ exit
$$ prt=="@prt"""
$$ prt/que=TCPIP$LPD_IN_ATHENA_1 login.com
%DCL-E-OPENIN, error opening prt" /que=TCPIP$LPD_IN_ATHENA_1 login.com as input
-RMS-F-SYN, file specification syntax error
$$ prt=="@prt """
$$ prt/que=TCPIP$LPD_IN_ATHENA_1 login.com
Job LOGIN (queue TCPIP$LPD_IN_ATHENA_1, entry 4) pending
pending status caused by queue stopped state
$$
.
Bojan Nemec
Honored Contributor

Re: Server Que

Uwe,

The missing blank at the end was a typo. What hapens with the parameters? Probably you receive the rest of the line in P1. And what hapens if you have a quoted string in your line? I'm stil away from a VMS machine so I cant test.

About Joseph problem I think that writing a new symbiont will be the best solution. This symbiont could work as a multi printer symbiont (open connection to more printers and print simultaneously on all printers) or just do a requeue to other queues. But I think that this is not a simple task. How to solve the /delete qualifier? (This problem is also present in the simple command procedure).

Bojan
Uwe Zessin
Honored Contributor

Re: Server Que

Hello Bojan,
I wasn't trying to present a solution - I am glad I didn't ;-)

Your comment clearly shows this cannot easily solved with a DCL procedure, but I am not surprised, either.
.
Antoniov.
Honored Contributor

Re: Server Que

Hi Bojan and Uwe,
I posted a warning to avoid %DCL-W-IVQUAL error as you said.
As you mentioned there are two workarounds:
1) PRT="@PRT ""
with blank and two (or three) double quotes;
this passes a unique parameter P1 without uppercase conversion to procedure; it's difficult analyze the parameters
2) PRT="@PRT """"
with blank and four double quotes;
this passes a 1.st empty qualifier and other converting in uppercase;
in this case you have only 7 qualifier.

Antonio Vigliotti
Antonio Maria Vigliotti