Transaction management systems on z/OS
|
Previous topic |
Next topic |
Contents |
Glossary |
Contact z/OS |
PDF
CICS program control Transaction management systems on z/OS |
|
|
A transaction (task) may execute several programs in the course of completing its work. The program definition contains one entry for every program used by any application in the CICS® system. Each entry holds, among other things, the language in which the program is written. The transaction definition has an entry for every transaction identifier in the system, and the important information kept about each transaction is the identifier and the name of the first program to be executed on behalf of the transaction. You can see how these two sets of definitions, transaction and
program, work in concert:
There are two CICS commands for passing control from one program to another. One is the LINK command, which is similar to a CALL statement in COBOL. The other is the XCTL (transfer control) command, which has no COBOL counterpart. When one program links another, the first program stays in main storage. When the second (linked-to) program finishes and gives up control, the first program resumes at the point after the LINK. The linked-to program is considered to be operating at one logical level lower than the program that does the linking. In contrast, when one program transfers control to another, the first program is considered terminated, and the second operates at the same level as the first. When the second program finishes, control is returned not to the first program, but to whatever program last issued a LINK command. Some people like to think of CICS itself as the highest program level in this process, with the first program in the transaction as the next level down, and so on. Figure 1 illustrates this concept. The LINK command looks like this:
EXEC CICS LINK PROGRAM(pgmname)
COMMAREA(commarea) LENGTH(length) END-EXEC.
where pgmname is the name of the program to which you wish to link. commarea is the name of the area containing the data to be passed and/or the area to which results are to be returned. The COMMAREA interface is also an option to invoke CICS programs. A sound principle of CICS application design is to separate the presentation logic from the business logic; communication between the programs is achieved by using the LINK command and data is passed between such programs in the COMMAREA. Such a modular design provides not only a separation of functions, but also much greater flexibility for the Web enablement of existing applications using new presentation methods. |
Copyright IBM Corporation 1990, 2010 |