(9863) Batch SUBMIT Process ID (PID)?

Archive of the OpenVMS Ask the Wizard (ATW) questions and answers database.
Locked

Topic author
User
Visitor
Posts: 0
Joined: Mon Jan 10, 2022 8:16 am
Reputation: 0
Status: Offline

(9863) Batch SUBMIT Process ID (PID)?

Post by User » Tue Oct 05, 2004 9:26 am

Is there a way to determine the Process ID of the process that submitted a batch job? I looked at all of the F$GETJPI and F$GETQUI items, but none seem to be able to give me this information. I have a need for a batch job to know "who submitted me", by PID, not username.
Last edited by marty.stu on Mon Aug 22, 2022 3:13 am, edited 1 time in total.


Wizard
Visitor
Posts: 0
Joined: Mon Jan 10, 2022 8:17 am
Reputation: 0
Status: Offline

Re: (9863) Batch SUBMIT Process ID (PID)?

Post by Wizard » Wed Oct 06, 2004 9:26 am

The submittor's PID is not stored in a queue entry, and is thus not available within the sys$getqui/f$getqui environment.

With appropriate auditing, it is possible to ensure that the information is recorded in the audit journal. However, determining the match at run-time would require privilege and would be costly in terms of opening and searching the journal.

If your submittor is cooperative, you can pass the information to the batch job as a parameter:

Code: Select all

    $ SUBMIT myjob/PARAMETER=('F$GETJPI("","PID")')
The batch job will then find the PID string in P1

The OpenVMS Wizard will assume you are aware the submitting process may well exit long before the batch jon starts.

Existing discussions of the f$getqui lexical include the following topics: (813), (1240), (2159), (3951), (4546), (4568), (4903), (5188), (5471), (5567), (5651), (5793), (5982), (6315), (6877), (9130), (9863), etc.
Last edited by marty.stu on Mon Aug 22, 2022 3:35 am, edited 1 time in total.

Locked