Each user-id can have a logon Proc (specified using SSM). Also, each account can have a logon Proc; this is an item in the account's MD with the same name as the account.
At logon, if the user has a logon Proc that exists in the MD of the account, it is executed. If not, the account's logon Proc (if defined) is executed. When you LOGTO an account, the account's logon Proc (if defined) is executed.
The logon Proc can, for example: implement a security system, display a particular menu, or set terminal characteristics.
If the System Dictionary account definition item contains an 'R' in attribute 9, a break and END combination invokes the account's logon Proc. This aids in keeping users out of TCL altogether. Of course, all programs in the account will have to avoid explicit exits to TCL. Additionally, a 'T' in attribute 9 causes a Proc to be executed on attempted exit to TCL, if the system is configured appropriately. Alternatively, the user's profile can prevent access to TCL. For more details, refer to the descriptions of how to set up user profiles using the SSM command and of Account Logon Procs.
For instance, suppose you have a DataBasic program, called MENU in file BP, which provides a menu screen and selections. To run the program at logon, create an item (a calling entry) in the MD of the account it is to be executed from. This would be named as the user-id's logon Proc, or be given the name of the account, if no user-id logon Proc is defined:
001 PQN 002 HRUN BP MENU 003 P
Another possibility is that your start-up program is a lengthy Proc. Then it should be in a file for Procs, in this case we'll call it PROCFILE. The start-up Proc can have the same item-id as the calling item mentioned above. The MD item would look like this:
001 PQN 002 (PROCFILE)
If the start-up program and all programs accessed via the start-up program do not contain explicit exits to TCL, AND if attribute 9 of the System Dictionary definition item for the account contains an R, users on this account will be kept out of TCL. If a break to a Debugger is made, when END is typed, control passes to the logon Proc rather than TCL.