Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Commit and Rollback Helpers z/OS Batch Runtime Planning and User's Guide SA23-1376-00 |
|||||||
Although the batch runtime commit and rollback methods can be called using the JNI as shown above, the process is cumbersome. To simplify the process, the batch runtime is providing the convenience methods bcdcommit() and bcdrollback() that can be called directly from a PL/I or COBOL application. Use of the helpers replaces the JNI calls to callback to the batch container. The methods reside in a new DLL bcdlibuser.so that will be shipped with this line item. For PL/I callers, an include file is provided in SYS1.SAMPLIB(BCDPLIH) that defines the entry points. COBOL applications do not need the include file and can just call the methods directly. Both COBOL and PL/I applications must include the bcdlibuser.x side deck when binding their applications to make the methods accessible to the program. SyntaxThe syntax of calling the methods varies based on the calling language as shown in the figures below. Figure 1. PL/I bcdcommit() Syntax
Figure 2. PL/I bcdrollback()
Syntax
Figure 3. COBOL bcdcommit() Syntax
Figure 4. COBOL bcdrollback()
Syntax
Return CodesThe bcdcommit() and bcdrollback() methods set a return code as follows:
The methods can also throw a Java™ exception in the event the callback to the batch runtime fails. The following is sample JCL to compile and bind the PL/I sample. Note that the helper method side deck must be included in the bind step to make the methods accessible to the application. Figure 5. Sample PL/I Compile and Bind JCL for bcdcommit() and bcdrollback()
Helpers
Using the bcdcommit() and bcdrollback() helpers from PL/IThe sample below shows a PL/I caller invoking the bcdcommit() and bcdrollback() methods to commit a transaction instead of calling the JNI directly. Figure 6. Sample
PL/I Commit Transaction Using bcdcommit() and bcdrollback()
|
Copyright IBM Corporation 1990, 2014
|