^ZWELCOME Routine
When the ObjectScript shell starts, the code checks for the existence of a routine called ^ZWELCOME in the %SYS namespace. If such a routine is found, it is invoked immediately prior to the shell login sequence, if any. The name of the routine implies its intended use, as a custom identification and welcome message to users.
Here is a simple example:
^ZWELCOME() PUBLIC ;
; Example
Write !
Set ME = ##class(%SYS.ProcessQuery).%OpenId($JOB)
Write "Now: ", $ZDATETIME($HOROLOG, 3, 1), !
Write "Pid/JobNo: ", ME.Pid, "/", ME.JobNumber, !
Write "Priority: ", ME.Priority, !
Quit
To create the ^ZWELCOME routine (which must be in the %SYS namespace), you must have administrator privileges and write access to the IRISSYS database.
Caution:
The ^ZWELCOME routine runs in the %SYS namespace with an empty $USERNAME and with $ROLES set to %ALL. Take care to ensure that the failure modes of ^ZWELCOME are benign. Also, this routine should not modify the $ROLES variable.