<?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%24SETPRV%28%29</id>
	<title>F$SETPRV() - 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%24SETPRV%28%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.vmssoftware.com/index.php?title=F$SETPRV()&amp;action=history"/>
	<updated>2026-04-30T15:04:39Z</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$SETPRV()&amp;diff=2456&amp;oldid=prev</id>
		<title>Marty.stu: /* Examples */</title>
		<link rel="alternate" type="text/html" href="https://wiki.vmssoftware.com/index.php?title=F$SETPRV()&amp;diff=2456&amp;oldid=prev"/>
		<updated>2021-12-14T13:49:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Examples&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:49, 14 December 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l18&quot;&gt;Line 18:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  $ OLDPRIV = F$SETPRV(&amp;quot;OPER,NOTMPMBX&amp;quot;)  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  $ OLDPRIV = F$SETPRV(&amp;quot;OPER,NOTMPMBX&amp;quot;)  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  $ SHOW SYMBOL OLDPRIV OLDPRIV = &quot;NOOPER,TMPMBX&quot;  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  $ SHOW SYMBOL OLDPRIV&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;   &lt;/ins&gt;OLDPRIV = &quot;NOOPER,TMPMBX&quot;  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this example, the process is authorized to change the OPER (operator) and TMPMBX (temporary mailbox) privileges. The F$SETPRV function enables the OPER privilege and disables the TMPMBX privilege. In addition, the F$SETPRV function returns the keywords NOOPER and TMPMBX, showing the state of these privileges before they were changed. You must place quotation marks (&amp;quot; &amp;quot;)  around the list of privilege keywords because it is a string literal.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this example, the process is authorized to change the OPER (operator) and TMPMBX (temporary mailbox) privileges. The F$SETPRV function enables the OPER privilege and disables the TMPMBX privilege. In addition, the F$SETPRV function returns the keywords NOOPER and TMPMBX, showing the state of these privileges before they were changed. You must place quotation marks (&amp;quot; &amp;quot;)  around the list of privilege keywords because it is a string literal.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Marty.stu</name></author>
	</entry>
	<entry>
		<id>https://wiki.vmssoftware.com/index.php?title=F$SETPRV()&amp;diff=872&amp;oldid=prev</id>
		<title>Darya.zelenina: Created page with &quot;&#039;&#039;&#039;F$SETPRV&#039;&#039;&#039; is a lexical function that enables or disables specified user privileges. The F$SETPRV function returns a list of keywords...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.vmssoftware.com/index.php?title=F$SETPRV()&amp;diff=872&amp;oldid=prev"/>
		<updated>2019-06-29T10:35:44Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;F$SETPRV&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 enables or disables specified user &lt;a href=&quot;/Privileges&quot; title=&quot;Privileges&quot;&gt;privileges&lt;/a&gt;. The F$SETPRV function returns a list of keywords...&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$SETPRV&amp;#039;&amp;#039;&amp;#039; is a [[Lexical functions|lexical function]] that enables or disables specified user [[Privileges|privileges]]. The F$SETPRV function returns a list of keywords indicating user privileges; this list shows the status of the specified privileges before F$SETPRV was executed. Your process must be authorized to set the specified privilege.&lt;br /&gt;
&lt;br /&gt;
=Syntax=&lt;br /&gt;
&lt;br /&gt;
F$SETPRV(priv-states)&lt;br /&gt;
&lt;br /&gt;
=Return Value=&lt;br /&gt;
&lt;br /&gt;
A character string containing keywords for the current process privileges before they were changed by the F$SETPRV function. LEXICALS &lt;br /&gt;
&lt;br /&gt;
=Arguments=&lt;br /&gt;
&lt;br /&gt;
==priv-states== &lt;br /&gt;
&lt;br /&gt;
Specifies a character string defining a privilege, or a list of privileges separated by commas (,).&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
&lt;br /&gt;
 $ OLDPRIV = F$SETPRV(&amp;quot;OPER,NOTMPMBX&amp;quot;) &lt;br /&gt;
 $ SHOW SYMBOL OLDPRIV OLDPRIV = &amp;quot;NOOPER,TMPMBX&amp;quot; &lt;br /&gt;
&lt;br /&gt;
In this example, the process is authorized to change the OPER (operator) and TMPMBX (temporary mailbox) privileges. The F$SETPRV function enables the OPER privilege and disables the TMPMBX privilege. In addition, the F$SETPRV function returns the keywords NOOPER and TMPMBX, showing the state of these privileges before they were changed. You must place quotation marks (&amp;quot; &amp;quot;)  around the list of privilege keywords because it is a string literal. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 $ SHOW PROCESS/PRIVILEGE &lt;br /&gt;
  05-JUN-2001 15:55:09.60   RTA1:              User: HELRIEGEL&lt;br /&gt;
&lt;br /&gt;
           Process privileges:&lt;br /&gt;
&lt;br /&gt;
           Process rights identifiers:&lt;br /&gt;
            INTERACTIVE&lt;br /&gt;
            LOCAL&lt;br /&gt;
&lt;br /&gt;
 $ NEWPRIVS = F$SETPRV(&amp;quot;ALL, NOOPER&amp;quot;) &lt;br /&gt;
 $ SHOW SYMBOL NEWPRIVS &lt;br /&gt;
   NEWPRIVS = &amp;quot;NOCMKRNL,NOCMEXEC,NOSYSNAM,NOGRPNAM,NOALLSPOOL, &lt;br /&gt;
   NOIMPERSONATE,NODIAGNOSE,NOLOG_IO,NOGROUP,NOACNT,NOPRMCEB, &lt;br /&gt;
   NOPRMMBX,NOPSWAPM,NOALTPRI,NOSETPRV,NOTMPMBX,NOWORLD,NOMOUNT, &lt;br /&gt;
   NOOPER,NOEXQUOTA,NONETMBX,NOVOLPRO,NOPHY_IO,NOBUGCHK,NOPRMGBL, &lt;br /&gt;
   NOSYSGBL,NOPFNMAP,NOSHMEM,NOSYSPRV,NOBYPASS,NOSYSLCK,NOSHARE, &lt;br /&gt;
   NOUPGRADE,NODOWNGRADE,NOGRPPRV,NOREADALL,NOSECURITY,OPER&amp;quot; &lt;br /&gt;
 $ SHOW PROCESS/PRIVILEGE&lt;br /&gt;
&lt;br /&gt;
           05-JUN-2001 10:21:18.32   User: INAZU      Process ID: 00000F24&lt;br /&gt;
                                     Node: TOKNOW     Process name: &amp;quot;_FTA23:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           Authorized privileges:&lt;br /&gt;
            NETMBX    SETPRV    SYSPRV    TMPMBX&lt;br /&gt;
&lt;br /&gt;
           Process privileges:&lt;br /&gt;
            ACNT                 may suppress accounting messages&lt;br /&gt;
            ALLSPOOL             may allocate spooled device&lt;br /&gt;
            ALTPRI               may set any priority value&lt;br /&gt;
            AUDIT                may direct audit to system security audit log&lt;br /&gt;
            BUGCHK               may make bug check log entries&lt;br /&gt;
            BYPASS               may bypass all object access controls&lt;br /&gt;
            CMEXEC               may change mode to exec&lt;br /&gt;
            CMKRNL               may change mode to kernel&lt;br /&gt;
            DIAGNOSE             may diagnose devices&lt;br /&gt;
            DOWNGRADE            may downgrade object secrecy&lt;br /&gt;
            EXQUOTA              may exceed disk quota&lt;br /&gt;
            GROUP                may affect other processes in same group&lt;br /&gt;
            GRPNAM               may insert in group logical name table&lt;br /&gt;
            GRPPRV               may access group objects via system protection&lt;br /&gt;
            IMPERSONATE          may impersonate another user&lt;br /&gt;
            IMPORT               may set classification for unlabeled object&lt;br /&gt;
            LOG_IO               may do logical i/o&lt;br /&gt;
            MOUNT                may execute mount acp function&lt;br /&gt;
            NETMBX               may create network device&lt;br /&gt;
            OPER                 may perform operator functions&lt;br /&gt;
            PFNMAP               may map to specific physical pages&lt;br /&gt;
            PHY_IO               may do physical i/o&lt;br /&gt;
            PRMCEB               may create permanent common event clusters&lt;br /&gt;
            PRMGBL               may create permanent global sections&lt;br /&gt;
            PRMMBX               may create permanent mailbox&lt;br /&gt;
            PSWAPM               may change process swap mode&lt;br /&gt;
            READALL              may read anything as the owner&lt;br /&gt;
            SECURITY             may perform security administration functions&lt;br /&gt;
            SETPRV               may set any privilege bit&lt;br /&gt;
            SHARE                may assign channels to non-shared devices&lt;br /&gt;
            SHMEM                may create/delete objects in shared memory&lt;br /&gt;
            SYSGBL               may create system wide global sections&lt;br /&gt;
            SYSLCK               may lock system wide resources&lt;br /&gt;
            SYSNAM               may insert in system logical name table&lt;br /&gt;
            SYSPRV               may access objects via system protection&lt;br /&gt;
            TMPMBX               may create temporary mailbox&lt;br /&gt;
            UPGRADE              may upgrade object integrity&lt;br /&gt;
            VOLPRO               may override volume protection&lt;br /&gt;
            WORLD                may affect other processes in the world&lt;br /&gt;
&lt;br /&gt;
           Process rights:&lt;br /&gt;
            INTERACTIVE&lt;br /&gt;
            LOCAL&lt;br /&gt;
&lt;br /&gt;
           System rights:&lt;br /&gt;
            SYS$NODE_TOKNOW&lt;br /&gt;
&lt;br /&gt;
           $ NEWPRIVS = F$SETPRV(NEWPRIVS)&lt;br /&gt;
           $ SHOW PROCESS/PRIVILEGE&lt;br /&gt;
&lt;br /&gt;
           05-JUN-2001 16:05:07.23   RTA1:              User: JERROM&lt;br /&gt;
&lt;br /&gt;
           Process privileges:&lt;br /&gt;
            OPER                 operator privilege&lt;br /&gt;
&lt;br /&gt;
           Process rights identifiers:&lt;br /&gt;
            INTERACTIVE&lt;br /&gt;
            LOCAL&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the DCL command SHOW PROCESS/PRIVILEGE is used to determine the current process privileges. Note that the process has no privileges enabled. The F$SETPRV function is then used to process the ALL keyword and enable all privileges recording the previous state of each privilege in the symbol NEWPRIVS. Next, F$SETPRV processes the NOOPER keyword and disables the OPER (operator) privilege, recording the previous state of OPER in NEWPRIVS. Note that the OPER privilege appears in the returned string twice: first as NOOPER and then as OPER. Entering the command SHOW PROCESS/PRIVILEGE now shows that the current process has all privileges enabled except OPER. If the returned string is used as the parameter to F$SETPRV, the process has the OPER privilege enabled. This occurs because the OPER command was present twice in the symbol NEWPRIVS. As a result, F$SETPRV looked at the first keyword NOOPER and disabled the privilege. Finally, after processing several other keywords in the NEWPRIVS string, the OPER keyword is presented, allowing F$SETPRV to enable the OPER privilege. &lt;br /&gt;
&lt;br /&gt;
If you are using the ALL or NOALL keywords to save your current privilege environment, VSI recommends that you perform the following procedure to modify the process for a command procedure: &lt;br /&gt;
&lt;br /&gt;
 $ CURRENT_PRIVS = F$SETPRV(&amp;quot;ALL&amp;quot;) &lt;br /&gt;
 $ TEMP = F$SETPRV(&amp;quot;NOOPER&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
If you use this procedure, you can then specify the following command statement at the end of your command procedure so that the original privilege environment is restored: $ TEMP = F$SETPRV(CURRENT_PRIVS) &lt;br /&gt;
&lt;br /&gt;
 $ SAVPRIV = F$SETPRV(&amp;quot;NOGROUP&amp;quot;) &lt;br /&gt;
 $ SHOW SYMBOL SAVPRIV SAVPRIV = &amp;quot;GROUP&amp;quot; &lt;br /&gt;
 $ TEST = F$PRIVILEGE(&amp;quot;GROUP&amp;quot;) &lt;br /&gt;
 $ SHOW SYMBOL TEST &lt;br /&gt;
   TEST = &amp;quot;TRUE&amp;quot; &lt;br /&gt;
&lt;br /&gt;
In this example, the process is not authorized to change the GROUP privilege; however, the F$SETPRV function still returns the current setting for the GROUP privilege. The F$PRIVILEGE function is used to see whether the process has GROUP privilege. The return string, TRUE, indicates that the process has GROUP privilege, even though the F$SETPRV function attempted to disable the privilege. &lt;br /&gt;
&lt;br /&gt;
[[Category:Lexical Functions]]&lt;/div&gt;</summary>
		<author><name>Darya.zelenina</name></author>
	</entry>
</feed>