DB2 Server for VSE & VM: Application Programming


Using PL/I Sample Programs

ARIS6PLD is a PL/I language sample program for VSE systems that is shipped with the DB2 Server for VSE product. ARIS6PLC is a PL/I language sample program for VM systems that is shipped with the DB2 Server for VM product. It resides on the production disk for the base product. You may find it useful to print this sample program before going through this appendix as the hard copy will provide an illustration for many of the topics discussed here.

You can learn most of the rules for using SQL within PL/I just by scanning through the program. Note, in particular, how the program satisfies the requirements of the application prolog and epilog. Near the beginning of the program all the host variables are declared and error handling is defined. Near the logical end of the program, the database changes are rolled back, to assure the database remains consistent for each use of the sample program. For your own applications, of course, you will enter a commit.

The DCL statements for the host variables are determined by referring to Figure 130. That figure gives the PL/I representation for each of the DB2 Server for VSE & VM data types. When you are coding your own applications, you will need to obtain the data types of the columns that your host variables interact with. This can be done by querying the catalog tables, which are described in the DB2 Server for VSE & VM SQL Reference manual.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]