(9863) Batch SUBMIT Process ID (PID)?
(9863) Batch SUBMIT Process ID (PID)?
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.
Re: (9863) Batch SUBMIT Process ID (PID)?
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:
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.
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 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.