COMMUNICATING WITH TASKS AND PROGRAMS - IBM Mainframe

There are various ways in which one task can communicate with other tasks and programs. But it is very important that we use the right technique to ensure that data is available when the next task or program starts. Another important area is in determining what commands to use when transferring control between programs.

Data Storage Techniques

There are different ways of passing data and the most efficient and the one, which requires the fewest resources from CICS, is by using the DFHQOMMAREA. Unlike the Dynamic memory techniques (GETMA1N), the COMMAREA is maintained by CICS from one task to the next. That is, if a transaction issues a RETURN TRANSID or XCTL and specifies the COMMAREA, CICS will ensure that the next transaction receives it. The COMMAREA is not a fixed area throughout the dialogue. Instead, CICS allocates and deallocates it from task to task. This means that, if you specify a different area for COMMAREA in one program, the original COMMAREA is lost. For example assume that transaction A issues a XCTL to transaction B pointing to a COMMAREA that is 3000 bytes long. Transaction B specifies a DFHCOMMAREA of only 2000 bytes. If transaction B issues a XCTL back to transaction A the COMMAREA is now 2000 bytes and not 3000 bytes.

The same is not true for a CALL or LINK commands. In that case, the original data area is passed to the sub program and even if the sub program only defines and uses a smaller COMMAREA, the original COMMAREA is still intact. IBM recommends the COMMAREAs not to exceed 24K, but most programs use much smaller areas.

When the COMMAREA becomes insufficient to store the amount of data required to maintain a dialogue between tasks or when transaction A issues a XCTL to transaction B, but does not wish to ask transaction B to preserve data that will be needed when control reverts back to transaction A. CICS provides a facility whereby your application program can write the data into a Temporary Storage Queue (TSQ). Since TSQ is not treated as a file by CICS and does not require an FCT entry. TSQs once written remain in the CICS environment until either a transaction DELETES the Queue or the CICS is shut down. So when the use of the TSQ is over you should give an explicit Delete command.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics