1828983 Members
2267 Online
109986 Solutions
New Discussion

Re: F$GetQuI call

 
SOLVED
Go to solution
John Eerenberg
Valued Contributor

F$GetQuI call

I want to determine if a batch job exists within the specified queue(s). I would like to do it more directly, but the F$GetQuI call forces me to do two loops.

The outer loop is for the batch queue itself.
$ QueName=F$GetQuI("Display_Queue","Queue_Name","test_bat*","Wildcard")
I am okay with this since I have to scan all relevant queues.

The inner loop is what I want to eliminate.
Instead of
$ JobName=("Display_Job","Job_Name",,"All_Jobs")
and looping until I have a match or JobName .eqs. ""
is there a way to hand the F$GetQuI a jobname for a specific batch queue and get a true/false as to whether or not it exists?

I've tried several things and I come up emtpy handed.

I don't have to use F$GetQuI but I think it is my only alternative.
Any info one way or the other would be appreciated.
It is better to STQ then LDQ
9 REPLIES 9
Wim Van den Wyngaert
Honored Contributor

Re: F$GetQuI call

John,

I don't like the f$getq syntax but anyway ...
Yes you can but only if you are the owner of the job.

$ entr=f$getq("display_entry","job_name","MYJOB*")

No queue context is needed, only display_entry can be used and only the first job found is reported.
Wim
Antoniov.
Honored Contributor

Re: F$GetQuI call

Hello,
remove WILDCARD.
$ say="write sys$output"
$ QueName=F$GetQui("DIPSLAY_QUEUE",
"QUEUE_NAME","MY_QUEUE")
$ if QueName.eqs.""
$ then
$ say "Queue MYQUEUE doesnt exists!"
$ else
$ say "Queue MYQUEUE exists!!!!!"
$ endif

H.T.H.
Antoniov

Antonio Maria Vigliotti
Antoniov.
Honored Contributor

Re: F$GetQuI call

I've forgotten ...
you inquire also other info, for example you can read if queue is idle:
$ say="write sys$output"
$ QueName=F$GetQui("DIPSLAY_QUEUE",
"QUEUE_IDLE","MY_QUEUE")
$ if QueName
$ then
$ say "Queue MYQUEUE is idle"
$ else
$ say "Queue MYQUEUE is running
$ endif
Now I'm not in front of terminal so I can't post other info, but you can type help for furthermore details.

Regards
Antoniov

Antonio Maria Vigliotti
Jan van den Ende
Honored Contributor

Re: F$GetQuI call

Hi,

a little extension to Wim's answer:
You don'nt HAVE to own the job, but you need read access to the queue and to the job.
Access you can have of course by owning, but also by privilege or ACL-&-identifier.

But beware, like Wim said, you will ONLY get the FIRST matching job.

So, maybe the loop-within-loop construct wil be preferable, despite the unfriendly syntax (I got used to it, but I still don't like it, and I guess I never will)

HTH,

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Martin P.J. Zinser
Honored Contributor

Re: F$GetQuI call

Hello,

slightly off-topic, since not a DCL solution;-) but with Perl and the VMS::Queue modul you could do something like this:

%entry_cond = {jobname=>"BATSER"};
@entries = entry_list(\%entry_cond);
$entryprop = entry_info($entries[0]);
print $$entryprop{"SUBMISSION_TIME"}, "\n";

or whatever particular property you are interested in.

Greetings, Martin
Lokesh_2
Esteemed Contributor
Solution

Re: F$GetQuI call

Hi,

Using pipe...

$pipe sho que/all/full | sear tt:

HTH,
Best wishes,
Lokesh Jain
What would you do with your life if you knew you could not fail?
Wim Van den Wyngaert
Honored Contributor

Re: F$GetQuI call

Jan,

Fully priveledged I don't see the job I don't own. Are you sure ?

Wim

Wim
Jan van den Ende
Honored Contributor

Re: F$GetQuI call

Wim:

You're absolute right.
I wrote that at home from memory, but having tested it, my previous statement only applies if requesting info by giving the jobentryNUMBER, and not by jobNAME.

sorry for the confusion

jpe
Don't rust yours pelled jacker to fine doll missed aches.
John Eerenberg
Valued Contributor

Re: F$GetQuI call

Thanks for all the very timely responses. When I saw 8 responses this morning, I went "wow."
You guys are the best -- as is OpenVMS.

I liked the perl script (which we will be able to do later this year) and the pipe show command (sometime the obvious is not) is probably the most useful since due to this application, multiple job names within a queue doesn't matter.
And if I go with the pipe, then a loop with F$GetQui("DIPSLAY_QUEUE",
"QUEUE_IDLE","MY_QUEUE") would give me a very efficient way of getting what I need.

Now I have more then one option to consider. This is great.

john
It is better to STQ then LDQ