LOGIN.COM, or the personal login command procedure, is the default name for a command procedure that is executed before each user's process runs (interactive, batch or otherwise). Unless a different file specification is supplied in the user's SYSUAF record's LGICMD field, the system will look for a file called LOGIN.COM in the user's default directory and if found execute the latest version of it. LOGIN.COM is usually used to customize the user's environment: set up their terminal, define logical names, symbols and foreign commands, set prompt, display important information, etc. In case of a captive account, the personal login command procedure limits the user's actions, usually providing a menu and never allowing the user access to DCL.
LOGIN.COM executes before every batch job that a user runs, which could possibly lead to:
- the batch process hanging if LOGIN.COM contains commands requiring terminal interaction, such as SET TERMINAL/INQUIRE or INQUIRE, because there is no terminal
- uncontrollable creation of batch processes if LOGIN.COM contains SUBMIT commands
- longer execution times if LOGIN.COM is long and performs actions unnecessary for the purposes of the batch job etc.
The following code determines the mode in which the process runs and branches to the commands specific to that mode:
$ GOTO 'F$MODE()' $INTERACTIVE: $! put your interactive commands here $ $ $ EXIT $BATCH: $! put your batch mode commands here $ $ $ EXIT $NETWORK: $OTHER: $ EXIT