Generated EGL programs can transfer to or from IMSADF programs. Immediate program-to-program message switches can be performed between IMSADF II conversational programs and EGL segmented conversational programs generated with the spaADF build descriptor option set to YES. In addition, IMSADF II secondary transactions can be processed by EGL batch programs.
EGL cannot be used to initiate IMSADF II, but can be used to receive control from and return control to the IMSADF II transaction driver. This is supported only when the IMSADF II program system uses the IMSADF II 28-byte SPA with a work database.
//*** RECORD=ADFWKDB ****
// The sample segment layout of the ADFWORK database default
// segment size is 6000 bytes. Use this DLISegment definition
// to retrieve data from and store data into the ADF work database.
// Refer to the IMSADF Application Development Guide
// Appendix E for details on which fields to update.
// ***********************
Record ADFWKDB type DLISegment {
keyItem = "LTERMNME"
}
3 LTERMNME char(8) ;
3 SPALEGTH smallint ;
3 * char(4) ;
3 SPATRANS char(8) ;
3 * char(397) ;
3 SPABITS hex(2) ;
3 * char(6) ;
3 SPAFIRST smallint ;
3 SPARTNCD int ;
3 SPASECTX smallint ;
3 * char(4) ;
3 SPAPGOPT smallint ;
3 SPASWITH char(2) ;
4 RDFSWITH smallint ;
3 SPATRX char(3) ;
3 SPACGTRX char(3) ;
3 * char(66) ;
3 SPASHOTR char(8) ;
3 * char(31) ;
3 SPAKEYID char(255) ;
3 SPAFLDSG char(5192) ;
end // end ADFWKDB
Rational® COBOL Runtime for zSeries does not share its work database with IMSADF II; the two databases have different formats. Changes to the IMSADF II work database do not affect the Rational COBOL Runtime work database. Similarly, changes made by an EGL program to the Rational COBOL Runtime work database do not affect the IMSADF II work database.
ssssTcc
When the program user enters the IMSADF II transaction ID that corresponds to the EGL program, IMSADF II does an immediate program-to-program message switch to the requested transaction. IMSADF II writes its own 28-byte SPA to the IMS™ message queue to perform the switch.
The EGL program must be generated with the spaADF build descriptor option set to YES and spaSize set to 28 to match the IMSADF II SPA size. When IMS schedules the new transaction, the EGL program control logic reads the IMSADF II SPA from the I/O PCB. Because of these build descriptor options, the EGL program control logic does not modify the SPA in any way. Therefore, the EGL program can eventually do an immediate program-to-program message switch back to the IMSADF II conversational transaction driver. Switching directly to the IMSADF II sign-on transaction is not supported.
If multiple EGL programs run before transferring back to the IMSADF II conversational transaction driver, all the EGL programs must be generated with these same build descriptor options. The program control logic uses the Rational COBOL Runtime work database or a second message segment following the SPA to pass records between the EGL programs, thereby preserving the IMSADF II-formatted SPA. Both deferred and immediate program-to-program message switches can be used between the EGL programs.
You can also specify the spaStatusBytePosition=p build descriptor option, where p specifies an available byte in the IMSADF II SPA that can be used for EGL's segmentation status byte. All EGL programs involved in a series of message switches that started from the IMSADF II transaction driver must have the same spaSize, spaADF, and spaStatusBytePosition build descriptor options. Refer to your IMSADF II documentation for information on the positions in the SPA that are available.
As in a COBOL program, the EGL program can access the IMSADF II work database to use information or to modify information in the IMSADF II communication area. If you access the IMSADF II work database, the EGL program processes the IMSADF II work database the way it would any other program database. Use the record definition above to access the IMSADF II work database. If you use a DL/I IMSADF II work database, be sure to include a database PCB in the EGL program's PSB definition.
To switch back to the IMSADF II transaction driver, your EGL program should set flags in the IMSADF II work database that tell the transaction driver what to do when it receives control. Refer to the IMSADF II documentation for your system for additional information. The EGL program transfers control using a transfer to transaction statement that specifies no record. Set sysVar.transferName to the name of the new transaction to be started; this variable must contain the same value that was placed in the IMSADF II variable SPATRANS. The EGL program control logic inserts the SPA to cause an immediate program-to-program message switch back to IMSADF II.
The techniques described in this section are used only when there is a transfer from IMSADF II to a series of EGL programs and non-EGL programs prior to transferring back to IMSADF II. If only a single EGL program runs and then transfers back to IMSADF II, the program control logic automatically preserves the IMSADF II SPA. For transfers when IMSADF II is not involved, see “Transferring control in the IMS/VS environment.”
The following table shows the conventions used for transferring between EGL programs when the spaADF build descriptor option is set to YES. These conventions differ from the techniques used when IMSADF II is not involved in that special techniques are used to pass a record so the SPA can remain intact. ADF mode does not support transfers between segmented nonconversational programs.
| Action | Immediate switch (optional input form) | Deferred switch (with input form) |
|---|---|---|
| Coding and generating | Define both programs as segmented = YES. Generate both programs as conversational with the spaSize build descriptor set to 28 and the spaADF build descriptor option set to YES. | Define both programs as segmented = YES. Generate both programs as conversational with the spaSize build descriptor set to 28 and the spaADF build descriptor option set to YES. |
| Performing the transfer | The originating program cannot send a form. If it is an EGL program, it does this using a transfer to transaction statement with a record. | The originating program must write the form to a message queue associated with the terminal after first writing the SPA. If it is an EGL program, it does this using a show statement with a form and an optional record. |
| Using an input form | The target program can optionally have an input form. | The target program must have an input form. |
| Passing a record | The record is transferred in a message segment following the SPA. | The record, if any, is transferred through the work database. |
| Specifying segmentation status byte | If spaStatusBytePosition was specified, the target program always ignores the value of the segmentation status byte that is located in the SPA at the offset specified. | If spaStatusBytePosition was specified, the target program uses the value of the segmentation status byte at the offset specified when there is an input form integrity problem caused by the program user pressing PA1 or PA2. |
| The segmentation status byte specified by spaStatusBytePosition is used only for program to program transfers for conversational programs. The byte is present for transfers between conversational programs and other programs. However, a transferring non-EGL program should always set the byte to blank. A target non-EGL program can ignore the value of the segmentation status byte. | ||
With this technique two segmented conversational EGL programs can change both the transaction name and the PSB name without presenting a form to the program user. The two programs can use different FormGroups. For a skeleton definition of the two programs, see “Immediate switch between two EGL programs” in “Transferring control in the IMS/VS environment”; remember that you must set the spaADF build descriptor option to YES when IMSADF II programs are involved.
The EGL program control logic automatically preserves the SPA and manages the record that is passed as a message segment following the SPA for both programs A and B. Specify the same spaSize build descriptor option (28 bytes) for both programs A and B.
The non-EGL program must be an IMS conversational program. The EGL program must be defined similarly to program B in "Immediate switch between two EGL programs" in “Transferring control in the IMS/VS environment”; remember that you must set the spaADF build descriptor option to YES when IMSADF II programs are involved.
The non-EGL program must be an IMS conversational program. The EGL program must be defined similarly to program A in "Immediate switch between two EGL programs" in “Transferring control in the IMS/VS environment”; remember that you must set the spaADF build descriptor option to YES when IMSADF II programs are involved.
With this technique two segmented conversational EGL programs can change both the transaction name and the PSB name when a form is presented to the program user. The two programs must use the same FormGroup. You do not have to transfer a record, but a form is required. For a skeleton definition of the two programs, see “Deferred switch between two EGL programs” in “Transferring control in the IMS/VS environment”; remember that you must set the spaADF build descriptor option to YES when IMSADF II programs are involved.
The non-EGL program must be an IMS conversational program. Define the EGL program similarly to program B in "Deferred switch between two EGL programs" in “Transferring control in the IMS/VS environment”; remember that you must set the spaADF build descriptor option to YES when IMSADF II programs are involved.
The non-EGL program must be an IMS conversational program. Define the EGL program similarly to program A in "Deferred switch between two EGL programs" in “Transferring control in the IMS/VS environment”; remember that you must set the spaADF build descriptor option to YES when IMSADF II programs are involved. The EGL program must set the modified property to YES for all variable data fields on the form that the non-EGL program needs as input.