The $ZSETPRV function enables or disables privileges for the process and returns prior states for the specified privileges. The $ZSETPRV function is analogous to the DCL Lexical function F$SETPRV.
The format for the $ZSETPRV function is:
$ZSETPRV(expr)
The expression specifies a VMS privilege or a list of privileges, separated by commas, which $ZSETPRV() enables or, if they have a prefix of "NO", disables.
$ZSETPRV() returns a list similar to its argument with a prefix of "NO" on any privilege that was previously disabled.
$ZSETPRV() can always disable privileges; however, it cannot enable privileges to which the account does not have access.
$ZSETPRV() provides a tool for adjusting VMS privileges from within GT.M. Because the $ZSETPRV() return provides the prior state of the privileges in the same format as the function input, the program can subsequently use $ZSETPRV() to restore the prior state. For information on passive determination of privileges, refer to the section on $ZPRIVILEGE() in the "Functions" chapter in this manual GT.M Programmer's Guide.