<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.vmssoftware.com/index.php?action=history&amp;feed=atom&amp;title=F%24CONTEXT</id>
	<title>F$CONTEXT - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.vmssoftware.com/index.php?action=history&amp;feed=atom&amp;title=F%24CONTEXT"/>
	<link rel="alternate" type="text/html" href="https://wiki.vmssoftware.com/index.php?title=F$CONTEXT&amp;action=history"/>
	<updated>2026-04-30T15:25:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://wiki.vmssoftware.com/index.php?title=F$CONTEXT&amp;diff=487&amp;oldid=prev</id>
		<title>Darya.zelenina: Created page with &quot;&#039;&#039;&#039;F$CONTEXT()&#039;&#039;&#039; is a lexical function that specifies selection criteria for use with the F$PID() function which can obtain information about proces...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.vmssoftware.com/index.php?title=F$CONTEXT&amp;diff=487&amp;oldid=prev"/>
		<updated>2019-04-05T10:04:27Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;F$CONTEXT()&amp;#039;&amp;#039;&amp;#039; is a &lt;a href=&quot;/Lexical_functions&quot; title=&quot;Lexical functions&quot;&gt;lexical function&lt;/a&gt; that specifies selection criteria for use with the &lt;a href=&quot;/F$PID()&quot; title=&quot;F$PID()&quot;&gt;F$PID()&lt;/a&gt; function which can obtain information about proces...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;F$CONTEXT()&amp;#039;&amp;#039;&amp;#039; is a [[Lexical functions|lexical function]] that specifies selection criteria for use with the [[F$PID()]] function which can obtain information about processes from any node in an OpenVMS [[Cluster]].&lt;br /&gt;
&lt;br /&gt;
=Syntax=&lt;br /&gt;
&lt;br /&gt;
F$CONTEXT(context-type, context-symbol, selection-item, selection-value, value-qualifier)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;context-type:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifies the type of context to be built. At present, the only context type available is PROCESS, which is used in constructing selection criteria for F$PID. Privileges are not required to see processes for the same UIC. To see processes for another UIC in the same UIC group, you need the GROUP privilege, and to see processes systemwide, you need the WORLD privilege.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;context-symbol:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifies a symbol that DCL uses to refer to the context memory being constructed by the F$CONTEXT function. The function F$PID uses this context symbol to process the appropriate list of process identification (PID) numbers. Specify the context symbol by using a symbol. The first time you use the F$CONTEXT function in a command procedure, use a symbol that is either undefined or equated to the null string. The symbol created will be a local symbol of type &amp;quot;PROCESS_CONTEXT&amp;quot;. When the context is no longer valid-that is, when all PIDs have been retrieved by calls to the F$PID function or an error occurs during one of these calls-the symbol no longer has a type of &amp;quot;PROCESS_CONTEXT&amp;quot;. Then you can use the F$TYPE function in the command procedure to find out if it is necessary to cancel the context. After setting up the selection criteria, use this context symbol when calling F$PID.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;selection-item:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifies a keyword that tells F$CONTEXT which selection criterion to use. Use only one selection-item keyword per call to F$CONTEXT.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;col&amp;quot;; | Item&lt;br /&gt;
!colspan=&amp;quot;col&amp;quot;; | Value&lt;br /&gt;
!colspan=&amp;quot;col&amp;quot;; | Qualifiers&lt;br /&gt;
!colspan=&amp;quot;col&amp;quot;; | Comments&lt;br /&gt;
|-&lt;br /&gt;
| ACCOUNT&lt;br /&gt;
| String&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| Valid account name or list of names. The asterisk (*) and the percent sign (%) wildcard characters are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| AUTHPRI&lt;br /&gt;
| Integer&lt;br /&gt;
| GEQ,GTR,LEQ,LSS,EQL,NEW&lt;br /&gt;
| On Alpha, valid authorized base priority (0-63).&lt;br /&gt;
|-&lt;br /&gt;
| CANCEL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Cancels the selection criteria for this context.&lt;br /&gt;
|-&lt;br /&gt;
| CURPRIV&lt;br /&gt;
| Keyword&lt;br /&gt;
| ALL,ANY,EQL,NEQ&lt;br /&gt;
| Valid [[Privileges|privilege]] name keyword or list of keywords.&lt;br /&gt;
|-&lt;br /&gt;
| GRP&lt;br /&gt;
| Integer&lt;br /&gt;
| GEQ,GTR,LEQ,LSS,EQL,NEQ&lt;br /&gt;
| [[UIC]] group number&lt;br /&gt;
|-&lt;br /&gt;
| HW_MODEL&lt;br /&gt;
| Integer&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| Valid hardware model number&lt;br /&gt;
|-&lt;br /&gt;
| HW_NAME&lt;br /&gt;
| String&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| Valid hardware name or a list of keywords. The asterisk (*) and the percent sign (%) wildcard characters are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| JOBPRCCNT&lt;br /&gt;
| Integer&lt;br /&gt;
| GEQ,GTR,LEQ,LSS,EQL,NEQ&lt;br /&gt;
| Subprocess count for entire [[Job|job]].&lt;br /&gt;
|-&lt;br /&gt;
| JOBTYPE&lt;br /&gt;
| Keyword&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| Valid [[Job|job]]-type keyword. Valid keywords are DETACHED, NETWORK, BATCH, LOCAL, DIALUP, and REMOTE.&lt;br /&gt;
|-&lt;br /&gt;
| MASTER_PID&lt;br /&gt;
| String&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| [[PID]] of master process.&lt;br /&gt;
|-&lt;br /&gt;
| MEM&lt;br /&gt;
| Integer&lt;br /&gt;
| GEQ,GTR,LEQ,LSS,EQL,NEQ&lt;br /&gt;
| [[UIC]] member number.&lt;br /&gt;
|-&lt;br /&gt;
| MODE&lt;br /&gt;
| Keyword&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
|  Valid process mode keyword. Valid keywords are OTHER, NETWORK, BATCH, and INTERACTIVE. &lt;br /&gt;
|-&lt;br /&gt;
| NODE_CSID&lt;br /&gt;
| Integer&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| Node&amp;#039;s cluster ID number&lt;br /&gt;
|-&lt;br /&gt;
| NODENAME&lt;br /&gt;
| String&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| Node name or list of node names.&lt;br /&gt;
|-&lt;br /&gt;
| OWNER&lt;br /&gt;
| String&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| PID of immediate parent process.&lt;br /&gt;
|-&lt;br /&gt;
| PRCCNT&lt;br /&gt;
| Integer&lt;br /&gt;
| GEQ,GTR,LEQ,LSS,EQL,NEQ&lt;br /&gt;
| [[Subprocess]] count of process.&lt;br /&gt;
|-&lt;br /&gt;
| PRCNAM&lt;br /&gt;
| String&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| Process name or list of process names. The asterisk (*) and the percent sign (%) wildcard characters are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| PRI&lt;br /&gt;
| Integer&lt;br /&gt;
| GEQ,GTR,LEQ,LSS,EQL,NEQ&lt;br /&gt;
| Process priority level number (0-63, on [[Alpha]])&lt;br /&gt;
|-&lt;br /&gt;
| PRIB&lt;br /&gt;
| Integer&lt;br /&gt;
| GEQ,GTR,LEQ,LSS,EQL,NEQ&lt;br /&gt;
| Base process priority level number (0-63, on [[Alpha]])&lt;br /&gt;
|-&lt;br /&gt;
| STATE&lt;br /&gt;
| Keyword&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| Valid process state keyword. See [[F$GETJPI()]] for details.&lt;br /&gt;
|-&lt;br /&gt;
| STS&lt;br /&gt;
| Keyword&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| Valid process status keyword. See [[F$GETJPI()]] for details.&lt;br /&gt;
|-&lt;br /&gt;
| TERMINAL&lt;br /&gt;
| String&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| Terminal name or list of names. The asterisk (*) and the percent sign (%) wildcard characters are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| UIC&lt;br /&gt;
| String&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| [[Identifiers|UIC identifier]]&lt;br /&gt;
|-&lt;br /&gt;
| USERNAME&lt;br /&gt;
| String&lt;br /&gt;
| EQL,NEQ&lt;br /&gt;
| User name or list of user names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;selection-value:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifies the value of the selection criteria in the table above.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;value-qualifier:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifies qualifiers for selection values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;col&amp;quot;; | Qualifier&lt;br /&gt;
! colspan=&amp;quot;col&amp;quot;; | Description&lt;br /&gt;
|-&lt;br /&gt;
| LSS&lt;br /&gt;
| less than the selection-value&lt;br /&gt;
|-&lt;br /&gt;
| LEQ&lt;br /&gt;
| less than or equal to the selection-value&lt;br /&gt;
|-&lt;br /&gt;
| GTR&lt;br /&gt;
| greater than the selection-value&lt;br /&gt;
|-&lt;br /&gt;
| GEQ&lt;br /&gt;
| greater than or equal to the selection-value&lt;br /&gt;
|-&lt;br /&gt;
| EQL&lt;br /&gt;
| equal to the selection-value&lt;br /&gt;
|-&lt;br /&gt;
| NEQ&lt;br /&gt;
| not equal to the selection-value&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2;&amp;quot; | Mask value qualifiers&lt;br /&gt;
|-&lt;br /&gt;
| ALL&lt;br /&gt;
| all items in the list must be true for the process&lt;br /&gt;
|-&lt;br /&gt;
| ANY&lt;br /&gt;
| any items in the list must be true for the process&lt;br /&gt;
|-&lt;br /&gt;
| EQL&lt;br /&gt;
| the values must match exactly&lt;br /&gt;
|-&lt;br /&gt;
| NEQ&lt;br /&gt;
| the value must not match&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When using multiple selection values with a particular selection qualifier, a match on any one of the selection criteria is considered valid (as if an OR operand was in place); the selection values are not cumulative criteria (as if an AND operand was in place).&lt;br /&gt;
&lt;br /&gt;
The difference between ALL and EQL is that the values specified with ALL must exist, but other unspecified values can exist also. EQL requires that all values specified must exist, and all others may not. For example, to request those processes whose current privileges include TMPMBX (temporary mailbox) and OPER (operator), but may include other privileges, specify the ALL keyword. To request those processes whose current privileges are TMPMBX and OPER exclusively, specify the EQL keyword.&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$!Establish an error and Ctrl/Y handler&lt;br /&gt;
$!&lt;br /&gt;
$ ON ERROR THEN GOTO error&lt;br /&gt;
$ ON CONTROL_Y THEN GOTO error&lt;br /&gt;
$!&lt;br /&gt;
$ ctx = &amp;quot;&amp;quot;&lt;br /&gt;
$ temp = F$CONTEXT (&amp;quot;PROCESS&amp;quot;, ctx, &amp;quot;NODENAME&amp;quot;, &amp;quot;*&amp;quot;,&amp;quot;EQL&amp;quot;)&lt;br /&gt;
$ temp = F$CONTEXT (&amp;quot;PROCESS&amp;quot;, ctx, &amp;quot;USERNAME&amp;quot;, &amp;quot;M*,SYSTEM&amp;quot;,&amp;quot;EQL&amp;quot;)&lt;br /&gt;
$ temp = F$CONTEXT (&amp;quot;PROCESS&amp;quot;, ctx, &amp;quot;CURPRIV&amp;quot;, &amp;quot;SYSPRV,OPER&amp;quot;, &amp;quot;ALL&amp;quot;)&lt;br /&gt;
$!&lt;br /&gt;
$!Loop over all processes that meet the selection criteria.&lt;br /&gt;
$!Print the PID and the name of the image for each process.&lt;br /&gt;
$!&lt;br /&gt;
$loop:&lt;br /&gt;
$ pid = F$PID(ctx)&lt;br /&gt;
$ IF pid .EQS. &amp;quot;&amp;quot;&lt;br /&gt;
$ THEN&lt;br /&gt;
$     GOTO endloop&lt;br /&gt;
$ ELSE&lt;br /&gt;
$     image = F$GETJPI(pid,&amp;quot;IMAGNAME&amp;quot;)&lt;br /&gt;
$     SHOW SYMBOL pid&lt;br /&gt;
$     WRITE SYS$OUTPUT image&lt;br /&gt;
$     GOTO loop&lt;br /&gt;
$ ENDIF&lt;br /&gt;
$!The loop over the processes has ended.&lt;br /&gt;
$!&lt;br /&gt;
$endloop:&lt;br /&gt;
$!&lt;br /&gt;
$ EXIT&lt;br /&gt;
$!&lt;br /&gt;
$!Error handler. Clean up the context&amp;#039;s memory with&lt;br /&gt;
$!the CANCEL selection item keyword.&lt;br /&gt;
$!&lt;br /&gt;
$error:&lt;br /&gt;
$ IF F$TYPE(ctx) .eqs. &amp;quot;PROCESS_CONTEXT&amp;quot; THEN -&lt;br /&gt;
_$ temp = F$CONTEXT (&amp;quot;PROCESS&amp;quot;, ctx, &amp;quot;CANCEL&amp;quot;)&lt;br /&gt;
$!&lt;br /&gt;
$ EXIT&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
In this example, F$CONTEXT is called three times to set up selection criteria:&lt;br /&gt;
* The first call requests that the search take place on all nodes in the cluster. &lt;br /&gt;
* The second call requests that only the processes whose user name either starts with an &amp;quot;M&amp;quot; or is &amp;quot;SYSTEM&amp;quot; be processed. &lt;br /&gt;
* The third call restricts the selection to those processes whose current privileges include both SYSPRV (system privilege) and OPER (operator) and can have other privileges set.&lt;br /&gt;
&lt;br /&gt;
The command lines between the labels &amp;quot;loop&amp;quot; and &amp;quot;endloop&amp;quot; continually call F$PID to obtain the processes that meet the criteria set up in the F$CONTEXT calls. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Lexical Functions]]&lt;/div&gt;</summary>
		<author><name>Darya.zelenina</name></author>
	</entry>
</feed>