clearglobal
Description
Removes one named global variable from the current PDMShell session. It does not delete PDM variables, change data card values, or affect other sessions.
Syntax
clearglobal -name variableName
Parameters
| Parameter | Alias | Required | Description |
|---|---|---|---|
-name |
Yes | Name of the session global to remove. Names are case-insensitive and must start with a letter or underscore, followed by letters, numbers, or underscores. |
Example
setglobal -name Project -value "ABC-100"
clearglobal -name Project
getglobal -name Project
The clear command prints Cleared global variable Project. The subsequent read prints Global variable Project is not set.
Missing values and errors
- Clearing a valid name that is already absent prints
Global variable Name was not set.This is informational, not a command error. - A missing or invalid name produces a command error.
- There is no clear-all option or wildcard name. Clear each variable by name, or end the session to discard all of its globals.
Remarks
After removal, an unresolved ${global.Name} reference is left unchanged rather than replaced with an empty value. Set the variable again before using it in a command that expects a resolved value. Values previously copied into other globals are not changed by clearing their source.
Related commands
setglobal: create or replace a session global.getglobal: inspect remaining variables.- Global Variables overview.