The exconfig.c sample program demonstrates how to externally configure Client-Library application properties.
This sample requires you to edit the default runtime configuration file, $SYBASE/$SYBASE_OCS/config/ocs.cfg. The example sets the CS_CONFIG_BY_SERVERNAME Client-Library property and calls ct_connect with a server_name parameter set to “server1.” In response, Client-Library looks for a [server1] section in the external configuration file. To run the example, create $SYBASE/$SYBASE_OCS/config/ocs.cfg (if necessary) and add the section:
[server1] CS_SERVERNAME = real_server_name
where real_server_name is the name of the server that you want to connect to.
For more information on how Client-Library uses external configuration files, see “Using the Runtime Configuration File” in the Open Client Client-Library/C Reference Manual.