A simple program involves the following steps:
Set up the programming environment:
cs_ctx_alloc — Allocate a context structure. ct_init — Initialize the programming interface.
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.
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.
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.
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. |
![]() |