$GETSESSION (get session information)
$GETSESSION acquires the value specified with the -s option of the jamscript command. The syntax of the -s option is -s session-variable-name=value.
Syntax
return-value=$GETSESSION(session-variable-name)
Values
-
return-value
Specifies the name of the variable into which the acquired session information is set.
-
session-variable-name
Specifies the variable name of the session to be acquired, either as a constant or a variable. A constant must be enclosed in single quotation marks ('').
Status
The following table lists and describes the possible statuses:
Status |
Description |
---|---|
NORMAL |
Normal end |
NODATA |
The specified session variable does not exist. |
ERROR |
— |
Script execution interrupted |
An invalid argument was specified, or an error other than the above occurred. |
Remarks
If no information exists for the specified session variable name, a 0-byte character string is returned.
Example
The following example specifies the -s option of the jamscript command to acquire information (aaaa):
[SET_VALUE] VAL = $GETSESSION('OPTION') MSG = 'OPTION = ' + VAL $ECHO(MSG)
- Execution command:
-
jamscript -f C:\Test.txt -s OPTION=aaaa
- Execution result:
-
OPTION = aaaa