Skip to end of metadata
Go to start of metadata

Purpose

The ocs.cfg file is used to configure / add configuration properties to CT-library applications.  This guide will show you how you can use this file to alter your code without recompiling or changing it.

Overview

To configure an Open Client CT-Library application without changing the code you can use the ocs.cfg configuration file.  This file can also add connection properties and help debug issues for specific applications. The ocs.cfg file sample is located in $SYBASE/$SYBASE_OCS/config/sample.cfg on unix and $Sybase\$SYBASE_OCS\ini\sample.cfg on windows.

; This is the default external configuration definition file. Feel free to add your own customizations.
;
[DEFAULT]
        ; This is the default section loaded by applications that use
        ; the external configuration (CS_EXTERNAL_CONFIG) feature, but
        ; which do not specify their own application name (CS_APPNAME).
        ; Initially this section is empty - defaults from all properties
        ; will be the same as earlier releases of Open Client libraries.
[ANSI_ESQL]
        ; This section defines configuration which an ANSI conforming
        ; ESQL application should use to get ANSI - defined behavior
        ; from SQL Servers and Open Client libraries.  This set of
        ; configuration properties matches the set which earlier
        ; releases of ESQL (version 10.0.X) automatically set for
        ; applications during execution of a CONNECT statement.
        CS_CAP_RESPONSE = CS_RES_NOSTRIPBLANKS
        CS_EXTRA_INF = CS_TRUE
        CS_ANSI_BINDS = CS_TRUE
        CS_OPT_ANSINULL = CS_TRUE
        CS_OPT_ANSIPERM = CS_TRUE
        CS_OPT_STR_RTRUNC = CS_TRUE
        CS_OPT_ARITHABORT = CS_FALSE
        CS_OPT_TRUNCIGNORE = CS_TRUE
        CS_OPT_ARITHIGNORE = CS_FALSE
        CS_OPT_ISOLATION = CS_OPT_LEVEL3
        CS_OPT_CHAINXACTS = CS_TRUE
        CS_OPT_CURCLOSEONXACT = CS_TRUE
        CS_OPT_QUOTED_IDENT = CS_TRUE
; End of default sections
; This is a sample section showing how you might alter configuration
; properties for you Embedded SQL application.
[SAMPLE_ESQL]
        ; use most of the ANSI properties defined above
        include = ANSI_ESQL
        ; but override some default properties
        CS_OPT_CHAINXACTS = CS_FALSE ; run in autocommit mode

Other application names

  • [DEFAULT]  applications like Crystal Reports
  • [NAMED_APP_DEFAULT] for applications like commvault
  • [JS Agent] Job scheduler for ASE and Business Suite for ASE which can be scheduled by ASE Cockpit and DBA Cockpit
  • [Rep Server]
  • [SAP Sybase IQ] if using IQ add the following entry and these items are required CS_CAP_RESPONSE = CS_DATA_NOBIGDATETIME, CS_DATA_NOTIME,CS_DATA_NODATE
  • [backup server]   backup server for ASE
  • [bcp]
  • [isql]
  • [ConnectionServer] webi report from Designer Performance Management(PM) for Business intelligence platform and SAP BusinessObjecsts Business Intelligence Platform
  • [optdiag]

Simple Explanation

Open Client applications check for the ocs.cfg file by default.  The default location is in $SYBASE/$SYBASE_OCS/config/ocs.cfg.  When this file is picked up it will look for the application name in brackets.  The sample application above is ANSI_ESQL.  If the application name is found the properties will be set for the application.  This should overwrite the settings coded into the code.

If the application name is not specified by CS_APPNAME, then the default section is used.

However, if CS_APPNAME is used in the application and there is no entry in ocs.cfg file, the application will error and not function.
 isql -Usa -Psybase -Sase
CS-LIBRARY error:
        comn_get_cfg: user api layer: internal common library error: Configuration section isql not found.
CT-LIBRARY error:
        ct_connect(): user api layer: external error: The connection failed because of invalid or missing external configuration data.

To add a default username and password to isql:
[isql]
CS_USERNAME = username
CS_PASSWORD = password

isql -Sredhead
1>

This will ignore/overwrite the -U and -P options:
 isql -Uwrongusername -Pwrongpassword -Sboxname
1>

Debugging using ocs.cfg

You can use the ocs.cfg file to debug isql or other applications as well.  For isql you can add an entry into ocs.cfg for debugging purposes.

isql --appname “isql_dbg_net

ocs.cfg
[isql_dbg_net] 
CS_DEBUG = CS_DBG_NETWORK

isql debugging
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc20155.1500/html/newfesd/CIHGIDHE.htm

Debugging properties
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc32840.1570/html/ctref/CFADFJCG.htm

CS options available for the ocs.cfg options

Option descriptions and default values

Connection string options and default values

Related Documents

SAP Open Server and Open Client Configuration Guide current: The ocs.cfg file

Related sap notes/kbas

  • ASE
    • KBA 2061102 - ct_connect error indicating there is missing or invalid data when installing a character set/sort order - ASE
    • KBA 2001299 - Job Scheduler failed to start with ct_connect() error in JS log - SAP ASE
    • KBA 1942379 - How to setup password encryption between isql and ASE - SAP ASE
  • Business Suite with ASE
    • KBA 2667638 - ATM Job fails because of Commvault - SAP ASE for Business Suite
  • SAP IQ
    • KBA 2483463 - CTLibrary connection errors being reported in both SAP IQ and repserver.
    • KBA 2099160 - The connection failed because of invalid or missing external configuration data error during insert..location - SAP IQ
    • KBA 2669096 - Encrypted Passwords not accepted using isql - SAP IQ
    • KBA 2158964 - Connectivity libraries cannot be found on Insert Location - SAP IQ
    • KBA 2157007 - invalid or missing external configuration data error - SAP IQ
    • KBA 2146700 - INSERT LOCATION error The maximum number of connections have already been opened - SAP IQ
  • SAP SDK (misc)
    • KBA 2438236 - Default name for ocs.cfg - SDK for SAP ASE
    • KBA 2484060 - isql with ocs.cfg failing - SDK for SAP ASE
    • KBA 2510868 - Password Encryption and DB2 application fails with ocs.cfg -  SDK for SAP ASE
    • KBA 2013657 - Application fails to start with error The connection failed because of invalid or missing external configuration data - SDK for SAP ASE
    • KBA 2037904 - Start of Job Scheduler fails if ocs.cfg file is created - SAP ASE
    • KBA 2244384 - ocs.cfg may not accept application name if it contains both space and hyphen - SDK for SAP ASE
    • KBA 2495051 - ATM windows stop and go to scheduled status for SAP ASE for BS
    • KBA 2285427 - How to enable password encryption for Sybase ASE database connectivity in Crystal Reports?
    • KBA 2386935 - Dump database using remote backup server hits error The connection failed because of invalid or missing external configuration data - ASE
    • KBA 2578583 - BCP out performance degraded after changed column data type from datetime to bigdatetime - SDK for SAP ASE
    • KBA 1294595 - Unable to connect to Sybase 15
    • KBA 2360699 - Missing DSN Attributes for Python - SDK for SAP ASE
    • KBA 2686839 - When trying to create a report, the Error: 191, Severity: 0, Origin: 1, Layer: 1 is given.
    • KBA 2402287 - Request for net password encryption global setting for Open Client applications - SDK for SAP ASE
    • KBA 2475342 - How do you change the max connections in Open Client? - SDK for SAP ASE
    • KBA 2484406 - Setting up Cognos with ASE using password encryption - SAP SDK for ASE
  • Replication / SRS
    • KBA 2890296 - ERROR #31083 GLOBAL RS(GLOBAL RS) Cannot connect to RSSD server -  SRS
    • KBA 2365776 - ERROR #13114 Failed to allocate an environment structure for a Connector - SRS
    • KBA 2273134 - Unable to use Sybase ASE Database as a CMS database in BI 4.1 when Password encryption is enabled on the database
    • KBA 2635828 - Upgrade Visual Studio 2005 for SDK tools ocscfg.exe and dsedit.exe- SDK for SAP ASE
    • KBA 2160333 - How to suppress ASE Message 5704  in RepServer errorlog - SRS
    • KBA 2745045 -  Rep Agent connection failed because of invalid or missing external configuration data - SRS
  • KBA 2739933 - SAP BusinessObjects Business Intelligence CMS on ASE fails (The installed encryption handler returned a status that was not CS_SUCCEED)
  • KBA 1899405 - How to Setup OpenSwitch with SSL - SAP SWT
  • No labels