Getting Started with TRANSACT (32247-90007)

54 Chapter2
Using Character Mode I/O
Command Mode
3 A command is identified to Transact by the special characters “$$”. In our
program we have identified four commands. These are: HELP, ADD,
UPDATE, and DISPLAY.
We can think of commands as entry points into a program. Typically a
command will do a unit of work or a transaction.
We do not need to do anything special to identify the end of a command
sequence. During the processing flow, when Transact detects the starting
point of a new command, it returns control to the user and reissues the
prompt > for the user to specify a new command or transaction.
Command processing removes a lot of the control over processing flow from
the program and puts it in the Transact processor.
5 SET(COMMAND) sets up a mini help system within the program. If the
user types HELP, we display the valid commands for this program.
Transact also does this automatically if the user types in the special
command COMMAND.
The following example shows the execution of this program.