Operating System - OpenVMS
1820882 Members
3603 Online
109628 Solutions
New Discussion юеВ

Re: Determining "SPOOLED" Device

 
SOLVED
Go to solution
Jack Trachtman
Super Advisor

Determining "SPOOLED" Device

We have a number of LTA devices defined which are in turn set to spool output to telnetsym print queues (via the SET DEV/SPOOLED=(que-name, device) LTAnnn: cmd).

Is there a way to use DCL lexicals to start with a print que name and find which LTA device is spooling to it?

If the above can't be done, is it possible to look at an LTA device to see which print que it is spooled to?

TIA
14 REPLIES 14
Mike Kier
Valued Contributor

Re: Determining "SPOOLED" Device

This gets the spooled MultiNet devices, so it ought to work for spooled LAT devices as well:

f$GetQUI("DISPLAY_QUEUE", "DEVICE_NAME", "actual_queue_name")
Practice Random Acts of VMS Marketing
Jack Trachtman
Super Advisor

Re: Determining "SPOOLED" Device

The lexical you suggest returns the queue's printer's DNS name and port number, and not the spooled device I'm looking for.

But your suggestion made me realize that there is probably *no* direct connection between a print queue and any device that may be feeding it, i.e. the print queue doesn't need to know from where it got the print request.

So - my second question: how to look at an LTA device to see what print queue it is spooled to?
Dave Lennon
Advisor

Re: Determining "SPOOLED" Device

Jack,
Here's an "oldie but goodie" - watch out for formatting problems...

http://wwwvms.mppmu.mpg.de/vmssig/src/MAR/getspl.mar

Let us know if it still works...

Later,
Dave
Dave Lennon
Advisor

Re: Determining "SPOOLED" Device

If you have too much trouble with the above, this link looks better to me on a peecee...

http://vmsone.com/~decuslib/vaxsig/vax92b/alpha/hints/spooldev.code
John Gillings
Honored Contributor

Re: Determining "SPOOLED" Device

Jack,

You can use F$DEVICE to scan all LTA devices, and F$GETDVI to determine if they're spooled, and find the device name.

Attached is a sample command procedure
(one attachment per response, see next for the remainder of your question).

A crucible of informative mistakes
John Gillings
Honored Contributor

Re: Determining "SPOOLED" Device

Finding all queues pointing at spooled devices can be done with F$GETQUI. An example procedure is attached.

Note the "FREEZE_CONTEXT" on the specific "DISPLAY_QUEUE" - this is required to maintain the context of the wildcard QLOOP. You will also need it on any other "DISPLAY_QUEUE" calls if you want to gather more information about the queue.

Although it works on my system, I'm not certain that it's completely generic. I'm assuming that the queue device name for an LTA queue will be "serial/LTAxxxx" - the quoting of symbol dev is also a bit odd because I was too lazy to strip the double quotes from the device name. If your queue devices names have a different pattern, you'll need to modify the test to suit.
A crucible of informative mistakes
John Gillings
Honored Contributor

Re: Determining "SPOOLED" Device

Oops, just noticed you said:

>> (Mike) f$GetQUI("DISPLAY_QUEUE", "DEVICE_NAME", "actual_queue_name")
>
>The lexical you suggest returns the
>queue's printer's DNS name and port
>number, and not the spooled device I'm
>looking for.

On my system it returns, for example, "serial/LTA9999" (including the quotes).

Output from QUISPL.COM is:

Queue CSC$3500 => LTA9999 spooled to _DSA110:
Queue CSC$5100 => LTA9997 spooled to _DSA110:
Queue CSC$LN17PS => LTA9995 spooled to _DSA110:
Queue CSCU$3500 => LTA9998 spooled to _DSA100:
Queue OCCPR1 => LTA9994 spooled to _DSA110:
Queue OCCPR2 => LTA9996 spooled to _DSA110:

So now I'm curious about your queues. Are they really LAT devices?

Our startup procedure creates the queues with:

$ MCR LATCP CREATE PORT LTA9994
$ MCR LATCP SET PORT LTA9994/NODE=server/PORT=port

The queues are then created using DCPS with a P2 value of "auto=(node1,node2)::LTA9994:"

On another system, the LTA based queues have device names looking like "node::LTAnnn:", and F$GETQUI DEVICE_NAME returns just the LTA device name.

So, I've added a test to see if the device name returned by F$GETQUI exists, and assume it might be spooled. No doubt there are numerous other permutations that I don't know about (including the one on your system?). It's almost certainly possible to do what you want, but it may need some fiddling to work out the queue to LTA device mapping.
A crucible of informative mistakes
Wim Van den Wyngaert
Honored Contributor

Re: Determining "SPOOLED" Device

I searched for the same question (find devivce to which an lta is spooled) in 2004 and found no answer. So, now I simply do set dev /nospool for all spooled lta device (during shutdown, to avoid shadow merges).

VMS isn't perfect : there are sometimes set commands without corresponding show commands (other example is set audit/listener).

Wim
Wim
Wim Van den Wyngaert
Honored Contributor

Re: Determining "SPOOLED" Device

I sure look silly now with the answer of John.

I mixed it up with another question : how to find the files that are open on a disk when they are not returned by show dev/fi. I didn't get a solution because
1) I'm unable to install the latest shadowing software
2) VMS has no way of showing the files

So, I get shadow merges each time I reboot.

Wim
Wim
Jack Trachtman
Super Advisor

Re: Determining "SPOOLED" Device

OK, sorry, I labled my question incorrectly

I'm not interested in the spooled device (that info can be easily gotten), what I'm trying to find is what *que name" the device is spooled to, ie, in the cmd

$ SET DEV LTAxxx: /SPOOLED=(que-name, disk)

I'm trying to get the que-name when I know the dev name (LTA in this case).

I've looked at the $GETDVI system service docs and don't see anything there.
Volker Halle
Honored Contributor

Re: Determining "SPOOLED" Device

Jack,

the program refered to by David's entry does what you want.

And there's always SDA:

$ sho dev lta1

Device Device Error
Name Status Count
LTA1: Online spooled 0

$ ANAL/SYS
SDA> READ SYSDEF
SDA> SHOW DEV LTA1:
...
SDA> exa @(ucb+ucb$l_vcb)+vcb$b_status+1;10
FFFFFFFF 809217E4 54534554 041101C0 ├Г ...TEST├Г┬д....... 83082508
00A54258 90EC3719 00000000 00058268 h........7├Г┬м.XB├В┬е. 83082518

The queue name starts at offset VCB$B_STATUS+1 and the length of the string is stored at VCB$B_STATUS, so in this case, the queue name is TEST.

Volker.
Jack Trachtman
Super Advisor

Re: Determining "SPOOLED" Device

Volker,

Thanks for pointing me to the macro routine - I originally thought it just returned the spooled device.

1) The macro routine assembles w/o error,
but when linking I get "undefined symbol IOC$VERIFYCHAN". What do I need to add to my LINK statement?

2) I'd rather use your ANA/SYS cmds.
- can that be scripted?
- looks like the que name starts on a word boundary, but how would I programmatically tell how long the que name is?

Thanks
Volker Halle
Honored Contributor
Solution

Re: Determining "SPOOLED" Device

Jack,

the GETSPL.MAR example program is privileged code and needs to be linked against the OpenVMS executive:

$ LINK/SYSEXE GETSPL.OBJ

As this program contains kernel mode code ($CMKRNL_S), it could crash your system.

$ link/sysexe getspl
$ run getspl
Device: lta1:
TEST
DSA3

I would suggest to add the following line:

.entry getspl_k,^m

moval g^lib$sig_to_ret,(FP) ; prevent crash in case of error

The length of the queue name is stored in the byte at VCB$B_STATUS

SDA> def size= @(@(ucb+ucb$l_vcb)+vcb$b_status)&ff
SDA> eva size
Hex = 00000000.00000004 Decimal = 4

This could be scripted. You can send the SDA output to a file by using SDA> SET LOG file, but I would think the GETSPL program is the better way.

Volker.
Jack Trachtman
Super Advisor

Re: Determining "SPOOLED" Device

Volker,

Thanks much.

My management won't allow me to install the privileged code macro, so I will be scripting the SDA solution. Since I will be starting with the que name, I'm going to have to look through all of the LTA devices for a match, so I'll see how efficient I can make the DCL code. And I see that SDA throws a warning if there is no associated spooled que.