Writing a SQLDA

To write a model SQLDA definition, perform the following steps:

  1. In the WORKING-STORAGE section of the RSP, include a SQLDA with a SQLVAR definition for each column you send in your result.

    NoteSybase APIs use pointers; COBOL can only handle setting pointers in its linkage section.

  2. Include a description of the SQLDA template.

    The SQLDA template and the description go in the LINKAGE SECTION so they can be accessed by programs outside the RSP, such as MainframeConnect.

  3. Optionally, re-calculate the size of your SQLDA definition or as an alternative, you can have the compiler do this for you with (LENGTH OF).

    For an example of the compiler alternative, see Appendix B, “MODELRSP DB2 Output Pipe Sample RSP” in the 1100-TEST-SQLDA paragraph.

  4. Allocate storage for the model SQLDA definition and set a pointer to that address.

    For an example of this, see Appendix B, “MODELRSP DB2 Output Pipe Sample RSP” in the 1200-GET-STORAGE paragraph.

  5. Move the model SQLDA definition residing in WORKING-STORAGE into the template SQLDA (in the allocated storage in the linkage section).

    For an example of this, see Appendix B, “MODELRSP DB2 Output Pipe Sample RSP” in the 1300-SET-ADDRESSES paragraph.