Skip to main content

Problem:

Following is an example of the type of error that can occur at runtime when using a database such as Sybase that requires a pre-compiler.  

Load error : file 'CSBCTXGLOBAL'

error code: 173, pc=0, call=1, seg=0

173     Called program file not found in drive/directory

In this instance the Sybase runtime files had only been compiled to .gnt

Resolution:

This problem is due the Sybase run-time not being loaded.

We can get the Sybase run-time linked into COBOL program executable by compiling them to shared object (.so) files.

Following is an example of a portion of a compile script. Originally the Sybase files were compiled using cob -ug ....This has been changed to compile them as shared objects - cob -zUg. Also, note the inclusion of the U switch - this tells the compiler that subprograms will be dynamically loaded and will cause a compiler error if not included.

..........

# -ug compiles to gnt (u) and animate (g).

if (($line == 0));

then

      echo No SQL statements found, standard compile

#

cob -ug  $1 -C anim -C "COBIDY ASSIGN(EXTERNAL)" -C LIST="" -C SETTINGS=COL

#       rc=$?

   

cob -zUg  $1 -C anim -C "COBIDY ASSIGN(EXTERNAL)" -C LIST="" -C SETTINGS=COL

rc=$?

else

echo Found "$line" SQL statements, using Sybase pre-compiler

dos2unix -437 $1 $1

# in case source contains CR

#

cob -ug $1 -C "p(cobsql) csqlt==sybase endp" -L $SYBASE/OCS-12_5/devlib -lcobct -lct -lcs #        -lcomn -ltcl -lintl -lnsl -lm -C LIST="" -C SETTINGS=COL

#

rc=$?

cob -zUg $1 -C "p(cobsql) csqlt==sybase endp" -L $SYBASE/OCS-12_5/devlib -lcobct -lct -lcs -lcomn -ltcl -lintl -lnsl -lm -C LIST="" -C SETTINGS=COL

rc=$?

fi

etc.......

The compile script will now create an executable with a .so extension instead of .gnt. This can be run the same way ie. cobrun jobexec.so

Old KB# 4496

Problem:

Following is an example of the type of error that can occur at runtime when using a database such as Sybase that requires a pre-compiler.  

Load error : file 'CSBCTXGLOBAL'

error code: 173, pc=0, call=1, seg=0

173     Called program file not found in drive/directory

In this instance the Sybase runtime files had only been compiled to .gnt

Resolution:

This problem is due the Sybase run-time not being loaded.

We can get the Sybase run-time linked into COBOL program executable by compiling them to shared object (.so) files.

Following is an example of a portion of a compile script. Originally the Sybase files were compiled using cob -ug ....This has been changed to compile them as shared objects - cob -zUg. Also, note the inclusion of the U switch - this tells the compiler that subprograms will be dynamically loaded and will cause a compiler error if not included.

..........

# -ug compiles to gnt (u) and animate (g).

if (($line == 0));

then

      echo No SQL statements found, standard compile

#

cob -ug  $1 -C anim -C "COBIDY ASSIGN(EXTERNAL)" -C LIST="" -C SETTINGS=COL

#       rc=$?

   

cob -zUg  $1 -C anim -C "COBIDY ASSIGN(EXTERNAL)" -C LIST="" -C SETTINGS=COL

rc=$?

else

echo Found "$line" SQL statements, using Sybase pre-compiler

dos2unix -437 $1 $1

# in case source contains CR

#

cob -ug $1 -C "p(cobsql) csqlt==sybase endp" -L $SYBASE/OCS-12_5/devlib -lcobct -lct -lcs #        -lcomn -ltcl -lintl -lnsl -lm -C LIST="" -C SETTINGS=COL

#

rc=$?

cob -zUg $1 -C "p(cobsql) csqlt==sybase endp" -L $SYBASE/OCS-12_5/devlib -lcobct -lct -lcs -lcomn -ltcl -lintl -lnsl -lm -C LIST="" -C SETTINGS=COL

rc=$?

fi

etc.......

The compile script will now create an executable with a .so extension instead of .gnt. This can be run the same way ie. cobrun jobexec.so

Old KB# 4496

Can someone please help me in this same issue and I'm getting same and don't know what needs to be fixed.

Even I'm new to Visual Cobol code. So, looking your help to fix the above issue.



------------------------------
Senthilkumar Mukunthuthulasiram
General Reinsurance Corporation
------------------------------

Can someone please help me in this same issue and I'm getting same and don't know what needs to be fixed.

Even I'm new to Visual Cobol code. So, looking your help to fix the above issue.



------------------------------
Senthilkumar Mukunthuthulasiram
General Reinsurance Corporation
------------------------------

Hello,

You do not mention any specific product information.
Which COBOL product and version number are you using?
Which version of Sybase are you using?
On which OS and version number are you running?

Thanks



------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------

Hello,

You do not mention any specific product information.
Which COBOL product and version number are you using?
Which version of Sybase are you using?
On which OS and version number are you running?

Thanks



------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------

Hi Chris,

Please find the inline comments for the queries,

Which COBOL product and version number are you using? - Micro Focus Visual Cobol 9.0

Which version of Sybase are you using? - Sybase 16.0

On which OS and version number are you running? - Windows 10 Enterprise 64bit system

Could you please help me to fix this issue.



------------------------------
Senthilkumar Mukunthuthulasiram
General Reinsurance Corporation
------------------------------

Hi Chris,

Please find the inline comments for the queries,

Which COBOL product and version number are you using? - Micro Focus Visual Cobol 9.0

Which version of Sybase are you using? - Sybase 16.0

On which OS and version number are you running? - Windows 10 Enterprise 64bit system

Could you please help me to fix this issue.



------------------------------
Senthilkumar Mukunthuthulasiram
General Reinsurance Corporation
------------------------------

You have posted this question in the Net Express/Server Express product forum. Since you are using Visual COBOL you should post this question in the Visual COBOL forum, but I will try to help you here.

The article you found is for compiling and running Sybase on Linux/Unix and does not apply when running under Windows.

Do you have the Sybase environment variables setup correctly? I am not as familiar with Sybase as I am with other databases but there is normally a .bat file in the SYBASE install folder that needs to be run in order to setup the environment correctly, so it can locate it's run-time files.

Can you show me the command that you are using in order to compile your COBOL program?



------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------

You have posted this question in the Net Express/Server Express product forum. Since you are using Visual COBOL you should post this question in the Visual COBOL forum, but I will try to help you here.

The article you found is for compiling and running Sybase on Linux/Unix and does not apply when running under Windows.

Do you have the Sybase environment variables setup correctly? I am not as familiar with Sybase as I am with other databases but there is normally a .bat file in the SYBASE install folder that needs to be run in order to setup the environment correctly, so it can locate it's run-time files.

Can you show me the command that you are using in order to compile your COBOL program?



------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------

Hi Chris,

Yes, I can see 'Sybase.bat' file in the Sybase installed folder and I tried to run them. But it is not running properly. So, I added all the variables whatever available in the .bat file in the environment variables manually. Is there any issue with adding them by manually?

Can you show me the command that you are using in order to compile your COBOL program? - You mean the directives added in the Cobol program?



------------------------------
Senthilkumar Mukunthuthulasiram
General Reinsurance Corporation
------------------------------

Hi Chris,

Yes, I can see 'Sybase.bat' file in the Sybase installed folder and I tried to run them. But it is not running properly. So, I added all the variables whatever available in the .bat file in the environment variables manually. Is there any issue with adding them by manually?

Can you show me the command that you are using in order to compile your COBOL program? - You mean the directives added in the Cobol program?



------------------------------
Senthilkumar Mukunthuthulasiram
General Reinsurance Corporation
------------------------------

What do you mean that the .bat file is not running properly? Are you getting a specific error returned? You may have to run this as an administrator. Either open up an administrator command prompt and run it from there or use Windows Explorer. right-click on the .bat file and select Run as administrator. You should be able to add the environment variables manually but they should be set at the system level.

Questions about setting up Sybase properly should really be directed to SAP as it is their product and not a Rocket one.

Yes, please show me the directives that you are setting either within the program or within the IDE additional directives settings. 



------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------

What do you mean that the .bat file is not running properly? Are you getting a specific error returned? You may have to run this as an administrator. Either open up an administrator command prompt and run it from there or use Windows Explorer. right-click on the .bat file and select Run as administrator. You should be able to add the environment variables manually but they should be set at the system level.

Questions about setting up Sybase properly should really be directed to SAP as it is their product and not a Rocket one.

Yes, please show me the directives that you are setting either within the program or within the IDE additional directives settings. 



------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------

Hi Chris,

When we run the Sybase.bat file in administrator mode the variables are not setting in the environment variables field in the machine and there is no error. So, I added them manually in the environment variables field.

SQL Directives: SQL(TARGETDB=SYBASE) SQL(BEHAVIOR=OPTIMIZED)

We haven't added any directives in the Cobol tab in the project properties and below is the build settings showing,

anim cobidy warnings"1" max-error"100" profile

I have attached those screenshots for the reference.



------------------------------
Senthilkumar Mukunthuthulasiram
General Reinsurance Corporation
------------------------------

Hi Chris,

When we run the Sybase.bat file in administrator mode the variables are not setting in the environment variables field in the machine and there is no error. So, I added them manually in the environment variables field.

SQL Directives: SQL(TARGETDB=SYBASE) SQL(BEHAVIOR=OPTIMIZED)

We haven't added any directives in the Cobol tab in the project properties and below is the build settings showing,

anim cobidy warnings"1" max-error"100" profile

I have attached those screenshots for the reference.



------------------------------
Senthilkumar Mukunthuthulasiram
General Reinsurance Corporation
------------------------------

I was assuming that because you were using Sybase that you were using the Sybase cobpre preprocessor in conjunction with COBSQL.

The directives shown here are turning on the OpenESQL preprocessor which by default uses ODBC to connect to Sybase.
The screenshot also shows that this is compiled for 32-bit (x86). This means that you need to have a 32-bit Sybase ODBC driver installed and a DSN created for it using the 32-bit ODBC Administrator tool.

The first question would be do you have a 32-bit DSN created for the Sybase 32-bit ODBC driver?

If the ODBC DSN is for a 64-bit ODBC driver then you will need to compile your program for 64-bit (x64) or install the 32-bit version of the Sybase ODBC driver.



------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------