HP OpenVMS Systems

ask the wizard
Content starts here

Acquiring Process ID via DCL Lexical Function?

» close window

The Question is:

 
What is the best way to get the Current PID into a symbol / logical?
I tried F$PID() and looked at F$CONTEXT but I do which to use and how to
use.
 
 


The Answer is :

 
  The OpenVMS Wizard generally prefers to use the f$getjpi lexical function
  to acquire the current Process ID and load it into the DCL symbol "pid".
 
    $ pid = f$getjpi("0","PID")
 
  [The f$context and f$pid lexical functions are intended for use in
  interatively retrieving the process ID of each process on the OpenVMS
  system.  This pair of lexical functions is particularly useful when an
  OpenVMS DCL command procedure must consider each process on the system.]
 
  There are various resources available to assist you in learning DCL,
  please see the OpenVMS Frequently Asked Questions for books, and also
  see the OpenVMS User's Guide in the OpenVMS documentation set.

answer written or last revised on ( 7-SEP-1999 )

» close window