Appendix B. Original Examples in Additional Languages
This appendix contains examples from the following areas of this book. The program examples in this
appendix are rewritten from the original examples into other programming languages.
Chapter 3, “Common Information across APIs—Basic (OPM) Example”
Chapter 4, “Common Information across APIs—Advanced (ILE) Example”
Chapter 5, “List APIs”
Chapter 6, “Original Program Model (OPM) and Integrated Language Environment (ILE) Differences”
Appendix A, “Performing Tasks Using APIs—Examples”
This appendix also contains examples written in ILE C, ILE COBOL, and ILE RPG for using the integrated
file system.
The following tables describe the example tasks and refer you to the corresponding programming lan-
guage topic. In these tables, Yes means the task can be accomplished in the language identified but an
example is not provided. No means the task cannot be accomplished in the language identified.
Figure B-1. Original Program Model (OPM) API Examples from Chapter 3
Task
Programming Language and Location of Example
ILE C OPM COBOL ILE COBOL OPM RPG ILE RPG
Retrieving the HOLD Parameter (Exception
Messages) B-2 B-4 B-4 3-6 B-6
Handling Error Conditions No No No 3-8 B-8
Retrieving the HOLD Parameter (Error Code
Structure) B-10 B-12 B-12 3-11 B-14
Accessing the HOLD Attribute B-16 B-18 B-18 3-17 B-21
Accessing a Field Value (Initial Library List) B-22 B-25 B-25 3-19 B-29
Using Keys with List Spooled Files API B-33 B-38 B-38 3-24 B-42
Figure B-2. Integrated Language Environment (ILE) API Examples from Chapter 4
Task
Programming Language and Location of Example
ILE C OPM COBOL ILE COBOL OPM RPG ILE RPG
Register Exit Point and Add Exit Program 4-9 B-47 B-50 B-54 B-58
Retrieve Exit Point and Exit Program Informa-
tion 4-13 B-61 B-66 B-71 B-75
Remove Exit Program and Deregister Exit
Point 4-19 B-85 B-87 B-90 B-92
Figure B-3. List API Examples from Chapter 5
Task
Programming Language and Location of Example
ILE C OPM COBOL ILE COBOL OPM RPG ILE RPG
Listing Objects B-94 B-101 B-101 5-4 B-106
Figure B-4 (Page 1 of 2). Pointer API Examplesfrom Chapter 6
Task
Programming Language and Location of Example
ILE C OPM COBOL ILE COBOL OPM RPG ILE RPG
Logging Software Error (OPM API without
Pointers) 6-2 B-112 N/A B-116 B-119
Copyright IBM Corp. 1997 B-1