Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Lexical function

 
SOLVED
Go to solution
Just_Sergey
Occasional Advisor

Lexical function

Help me plz.
How can i get Entry number of executing job by f$getqui function??
I know just job name.
14 REPLIES 14
EdgarZamora_1
Respected Contributor

Re: Lexical function

More details would get you a more specific answer.

If you want to get the entry number of your currently executing job (from that job itself) then something like...

entry = f$getqui("display_job","entry_number",,"this_job")

If the job you're interested in is another job (not the process you're running in) then you would need to loop through the queues (or the specific queue if you know the queue name) then loop through the jobs in that queue and check for the specific job name you want. Once you find that job then you can get the entry number.
Wim Van den Wyngaert
Honored Contributor

Re: Lexical function

And note that the job name is not a unique key for getting a job (you can have 2 jobs calling "COMPILE").

Wim
Wim
Just_Sergey
Occasional Advisor

Re: Lexical function

2EdgarZamora: i have second case.
I'm interested in is another job.
And I know queue name, but I dont know how realize it. ((
Can you write some example?
2Wim Van den: I have just one job with this job_name
Robert Gezelter
Honored Contributor

Re: Lexical function

Just_Sergey,

As was implied by the other posts, one must be careful as it is possible to have multiple jobs of the same name in the queues and/or executing at the same time (for either the same user or different users).

Only the entry number is unique, so long as the job exists. Entry numbers can be quickly recycled, so care is recommended.

- Bob Gezelter, http://www.rlgsc.com
Wim Van den Wyngaert
Honored Contributor
Solution

Re: Lexical function

Here you have an example of a .com that creates (if not there) and deletes (if there) job entries.

Wim
Wim
Just_Sergey
Occasional Advisor

Re: Lexical function

I thought it would work. (in Attachment)
Naively )
Wim Van den Wyngaert
Honored Contributor

Re: Lexical function

Replace display_job by display_entry and it will.

Wim
Wim
Just_Sergey
Occasional Advisor

Re: Lexical function

It does not ((( Attach
EdgarZamora_1
Respected Contributor

Re: Lexical function

The attached sample code will do what you want. Tailor it for flexibility.

Wim Van den Wyngaert
Honored Contributor

Re: Lexical function

Are you system ? I just did the same test and it works for my job.

Wim
Wim
EdgarZamora_1
Respected Contributor

Re: Lexical function

Re my response... you might want to add a "BATCH" flag to the GETQUI for less overhead...

$ QNAME = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*","BATCH")
Just_Sergey
Occasional Advisor

Re: Lexical function

Thanks to all especially Wim Van den and his example. Found solution to a problem.
Duncan Morris
Honored Contributor

Re: Lexical function

Hi, Just_sergy

from your Forum Profile:


I have assigned points to 0 of 8 responses to my questions.


Maybe you can find some time to do some assigning?

http://forums1.itrc.hp.com/service/forums/helptips.do?#33

Mind, I do NOT say you necessarily need to give lots of points. It is fully up to _YOU_ to decide how many. If you consider an answer is not deserving any points, you can also assign 0 ( = zero ) points, and then that answer will no longer be counted as unassigned.
Consider, that every poster took at least the trouble of posting for you!

To easily find your streams with unassigned points, click your own name somewhere.
This will bring up your profile.
Near the bottom of that page, under the caption "My Question(s)" you will find "questions or topics with unassigned points " Clicking that will give all, and only, your questions that still have unassigned postings.

Thanks on behalf of your Forum colleagues.

PS. nothing personal in this. I try to post it to everyone with this kind of assignment ratio in this forum.

Just_Sergey
Occasional Advisor

Re: Lexical function

now know )