Basic control structures  A simple language program

Chapter 1: Open ClientConnect Processing

Steps in a simple program

A simple program involves the following steps:

  1. Set up the programming environment:

    cs_ctx_alloc — Allocate a context structure. ct_init — Initialize the programming interface.

  2. Establish a connection with a server or CICS or IMS region:

    ct_con_alloc — Allocate a connection structure. ct_con_props — Set or retrieve connection structure properties. ct_connect — Connect to a server.

  3. Send a command to the server or to a CICS or IMS region: (For three-tier processing, send a command to Mainframe ClientConnect which forwards the request to the target server, and routes the results back to the client program).

    ct_cmd_alloc — Allocate a command structure. ct_command — Initiate a language request or remote procedure call. ct_send — Send a request to the server.

  4. Process the results of the command:

    ct_results — Set up result data to be processed. ct_res_info — Return result set information. ct_bind — Bind a returned column or parameter to a program variable. ct_fetch — Fetch result data.

  5. Finish up:

    ct_cmd_drop — Deallocate a command structure. ct_close — Close a server connection. ct_con_drop — Deallocate a connection structure. ct_exit — Exit the programming interface. cs_ctx_drop — Deallocate a context structure.





Copyright © 2005. Sybase Inc. All rights reserved. A simple language program

View this book as PDF