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: 

LPQ command in DCL procedure has no timeout (Find a way to limit a command duration time)

 
SOLVED
Go to solution
Kortlandt
Advisor

LPQ command in DCL procedure has no timeout (Find a way to limit a command duration time)

Hiya,

I'm trying to generate an overview, with a DCL script, of all LPD printers, and check if they are available.

In the DCL procedure, I do

$ LPQ

But if there is no response, it'l hang endlessly. I can NOT mess with global timeout logicals.

I tried

$ PIPE LPQ | READ/TIMEOUT= SYS$PIPE a_line

But it does not work.

OpenVMS 7.2-2
TCPIP 5,1 ECO 4

Who can help me out?

Thnx,
Bob.
5 REPLIES
RBrown_1
Trusted Contributor

Re: LPQ command in DCL procedure has no timeout (Find a way to limit a command duration time)

Do these commands work interactively?
Hoff
Honored Contributor

Re: LPQ command in DCL procedure has no timeout (Find a way to limit a command duration time)

Upgrade? This is ancient stuff.

If you won't upgrade (which is what I suspect when presented with these cases), then you can brute-force a DCL timeout using a SPAWN that first issues a second nowait spawn of a subprocess that itself first finds and then waits and then kills its parent (and itself in the process), then issue the LPQ.

Alternatively, ping might provide a basic idea if the printer is reachable. (LPD/LPR is rather simple-minded, as printing software goes.) Or SNMP, if the printer supports it.

But getting (more) current software loaded would be better in general. Both OpenVMS Alpha and TCP/IP Services, and ECOs for same.
John Gillings
Honored Contributor
Solution

Re: LPQ command in DCL procedure has no timeout (Find a way to limit a command duration time)

Bob,
Try the attached command procedure

$ @CMD_TIMEOUT command...

For example:

$ @CMD_TIMEOUT 0:0:30.0 LPQ MYQUEUE

will give the command 30 seconds to complete. Status is that of the command or %SYSTEM-F-EXITFORCED if the command was timed out.
A crucible of informative mistakes
Phil.Howell
Honored Contributor

Re: LPQ command in DCL procedure has no timeout (Find a way to limit a command duration time)

If you have a look at the system startup procedures, some products (decwindows?) use a method of spawning subprocesses with /nowait and then waiting for completion.

or just use John's procedure
Kortlandt
Advisor

Re: LPQ command in DCL procedure has no timeout (Find a way to limit a command duration time)

Hello all,

@John:
This works fine for me, Thnx!


@Hoff:
- I am not able to upgrade, unfortunately.
- The spawn procedure you suggest is the CMD_TIMEOUT procedure of John.
- Pinging (Which I would prefer as well) is not an option, printer is just known as remote port on a remote machine in a different company then which I am in.

Thnx to you all for your response,

Grtz,
Bob