The flow of control when a DYNALLOC request is issued
The flow in a normal invocation is as follows. The main program, DFH99M, receives
control from CICS and carries out initialization. This includes determining the screen
size, allocating input and output buffer sections, and issuing initial messages. It then
invokes DFH99GI to get the input command from the terminal. Upon return, if the
command was null, the main program terminates, issuing a final message.
The command obtained has its start and end addresses stored in the global
communication area, COMM. The main program allocates storage for tokenized
text, and calls DFH99TK to tokenize the command. If errors were detected at this
stage, further analysis of the command is bypassed.
Following successful tokenizing, the main program calls DFH99FP to analyze the
verb keyword. DFH99FP calls DFH99LK to look up the verb keyword in the table,
DFH99T. DFH99LK calls DFH99MT if an abbreviation is possible. Upon finding the
matching verb, DFH99FP puts the address of the operand section of the table into
COMM, and puts the function code into the DYNALLOC request block.
The main program now calls DFH99KO to process the operand keywords. Each
keyword in turn is looked up in the table by calling DFH99LK, and the value coded
for the keyword is checked against the attributes in the table. DFH99KO then starts
off a text unit with the appropriate code and, depending on the attributes the value
should have, calls a conversion routine.
For character and numeric strings, DFH99CC is called. It validates the string, and
puts its length and value into the text unit.
For binary variables, DFH99BC is called. It validates the value, converts it to binary
of the required length, and puts its length and value into the text unit.
For keyword values, DFH99KC is called. It looks up the value in the description part
of the keyword table using DFH99LK, and puts the coded equivalent value and its
length into the text unit.
When a keyword specifying a returned value is encountered, DHF99KO makes an
entry on the returned value chain, which is anchored in COMM. This addresses the
keyword entry in DFH99T, the text unit where the value is returned, and the next
entry. In this case the conversion routine is still called, but it only reserves storage
in the text unit, setting the length to the maximum and the value to zeros.
When all the operand keywords have been processed, DFH99KO returns to the
main program, which calls DFH99DY to issue the DYNALLOC request.
DFH99DY sets up the remaining parts of the parameter list and, if no errors too
severe have been detected, a subtask is attached to issue the DYNALLOC SVC. A
WAIT EVENT is then issued against the subtask termination ECB. When the
subtask ends and CICS dispatches the program again, the DYNALLOC return code
is captured from the subtask ECB and the error and reason codes from the
DYNALLOC request block and a message is issued to give these values to the
terminal.
DFH99DY then returns to the main program, which calls DFH99RP to process
returned values. DFH99RP scans the returned value chain, and for each element
issues a message containing the keyword and the value found in the text unit. If a
DYNALLOC flow of control
Chapter 27. The dynamic allocation sample program 717