Product Documentation

Knowledgebase

Previous Topic

Next Topic

COBOL Troubleshooting

In This Chapter

COBOL Compilers Supported by FairCom RTG COBOL Edition

Troubleshooting Data Conversion Errors

Error: Requested def blk is empty

FairCom RTG SQL Access Errors

Previous Topic

Next Topic

COBOL Compilers Supported by FairCom RTG COBOL Edition

Tested and Supported

  • Veryant isCOBOL
  • ACUCOBOL-GT 6
  • ACUCOBOL-GT 7
  • ACUCOBOL-GT 8
  • ACUCOBOL-GT 9
  • Micro Focus Visual COBOL
  • Micro Focus Net Express
  • Micro Focus Server Express 5
  • Micro Focus COBOL 4
  • Micro Focus Server Express 4
  • Cobol-IT
  • Fujitsu NetCOBOL for .NET
  • Fujitsu NetCOBOL for Windows
  • Fujitsu NetCOBOL for Linux
  • P3/COBOL

Not Tested: Likely Supported

  • Fujitsu PowerCOBOL (through EXTFH interface)

Not Tested

  • Fujitsu COBOL
  • CA Realia COBOL

Not Supported

  • OpenCOBOL

Previous Topic

Next Topic

Troubleshooting Data Conversion Errors

The fact that the XDD initially does not contain any error handling information immediately exposes data conversion errors to a SQL user. This provides the way to begin troubleshooting data conversion errors and to identify the proper settings to specify in your XDD file.

Visually Check Data with FairCom DB SQL Explorer

FairCom DB SQL Explorer and FairCom DB Explorer include a button to simplify identifying "bad" records.

To check for bad records in FairCom DB SQL Explorer or FairCom DB Explorer:

  1. Select a sqlized table, such as custmast in the image above.
  2. Click the Table Records tab.
  3. A button labeled Check Bad Records appears at the right of the row of buttons (the image above shows the Java version of FairCom DB Explorer where the buttons are at the top of the tab; the .NET version, called FairCom DB SQL Explorer, shows this row of buttons at the bottom of the tab).
  4. Click the button to execute a SQL query to find records that did not sqlize properly.

Check using a SQL Query

You can use the procedures in this section to identify data-conversion errors and use that information to fine-tune your XDD files.

If a query fails, it is possible the failure is due to a problem with SQL data conversion. Troubleshooting this type of error is quite easy with the following steps:

  1. Identify the table (in case of a complex query) on which the conversion error occurs by running the following SQL statement on each table involved in the query:

    SELECT * FROM <table>

    If none of the queries fail, the original query failure is not due to a conversion problem.

  2. Run the following SQL statement to select only the records that do not properly convert:

    SELECT * FROM <table> ctoption(badrec)

    ctoption(badrec) is a FairCom DB extension to SQL indicating the query should return only records having conversion errors and expose values that do not properly convert as NULL.

  3. Look for NULL values returned from the query in step 2. These are the fields that do not properly convert. The remaining record values should be sufficient to identify the record that requires investigation.

CTSQLCBK.FCS Log

The ctoption(badrec) command generates a log file, ctsqlcbk.fcs, in the FairCom DB SQL Server directory that can be used to determine the exact conversion error and the data causing it. This file lists all the fields that caused a conversion error exposed in SQL along with the value of the data that could not be converted. Note that the log contains information for the fields that result in propagating the conversion error to SQL. It does not log conversion errors that result in a SQL value because they were already handled successfully following the settings in the XDD.

Each log entry is made of three lines:

  1. The first line is similar to the following:

    Convert error XXXX on field[YYYY]

    Where XXXX is the error code indicating the cause of the conversion error, YYYY is the field on which the conversion error occurred.

  2. The second line contains a message which gives internal information for FairCom technicians to identify where the error occurs in the code, as well as a message explaining the problem.
  3. The third line is a hexadecimal dump of the field content.

For example:

Convert error 4028 on field[FIELD1]

{ctdbStringFormatToDateTime} on 0000000000 failed

00000000

Convert error 4028 on field[FIELD2]

{ctdbStringFormatToDate} on 00000000 failed

3030303030303030

Convert error 4118 on field[FIELD3]

[NormalizeCobolStr] ascii value is not a digit

2020202020202020

Convert error 4118 on field[FIELD4]

[NormalizeCobolStr] ascii value is not a digit

2020202020202020

Previous Topic

Next Topic

Error: Requested def blk is empty

The following message was seen when attempting to connect to FairCom DB SQL after a COBOL table had been imported with the ctutil -sqlize option:

Error : -17438 "ExecuteReader - CT - Requested def blk is empty"

Along with that, the following message is logged in CTSTATUS.FCS

Mon Oct  1 13:59:43 2012
 - User# 00001 LoadSQLSDK: Failed to load SQL callback library libctsqlcbk.so: dynamic linker : ./ctreesql : could not open libctsqlcbk.so
Mon Oct  1 13:59:43 2012
 - User# 00001 : PANIC - TPEUTIL LoadSQLSDK callback library load failed PID 20028

A COBOL resource in the file is closely related to the referenced callback routine needed by SQL for data type conversions.

Configuring the LD_LIBRARY_PATH environment variable to correctly pick up the path to libctsqlcbk.so for the server process owner should correct this error.

Previous Topic

Next Topic

FairCom RTG SQL Access Errors

The FairCom RTG solution is enabled through a server-side callback module, which implements c-treeDB callback routines. Errors that occur within these routines generate a standard c-treeDB error code that is context sensitive to this implementation. Here is a list of possible return codes from this module, and their meaning in FairCom RTG XDD handling.

Symbolic

Error Code

Description

CTDBRET_CALLBACK_1

4109

Could not find schema in XDD

CTDBRET_CALLBACK_2

4110

Record length does not match extended data definitions

CTDBRET_CALLBACK_3

4111

Invalid or corrupted XDD resource

CTDBRET_CALLBACK_4

4112

Syntax error parsing extended data definitions

CTDBRET_CALLBACK_5

4113

Internal error

CTDBRET_CALLBACK_6

4114

Could not find field in XDD

CTDBRET_CALLBACK_7

4115

Could not find filter in XDD

CTDBRET_CALLBACK_8

4116

Too many schemas in XDD

CTDBRET_CALLBACK_9

4117

Error setting filter condition on schema

CTDBRET_CALLBACK_10

4118

Field value conversion error

CTDBRET_CALLBACK_11

4119

Unsupported CLOB/BLOB definition in XDD

CTDBRET_CALLBACK_12

4120

Index not supported on field type

CTDBRET_CALLBACK_13

4121

Missing or bad dbtype information in XDD

CTDBRET_CALLBACK_14

4122

Invalid filter key settings in XDD

CTDBRET_CALLBACK_15

4123

"Regular" field found after virtual fields in the XDD <schema> (in earlier releases: Invalid field default settings in XML definitions)

CTDBRET_CALLBACK_16

4124

Not used

CTDBRET_CALLBACK_17

4125

Key definition does not match XDD information

CTDBRET_CALLBACK_18

4126

Missing or bad value in XDD

CTDBRET_CALLBACK_19

4127

Internal error (unexpected field type)

CTDBRET_CALLBACK_20

 

Not used

TOCIndex