Product Documentation

FairCom RTG Utilitiesctutil-sqlcheck

FairCom RTG COBOL User Guide

Previous Topic

Next Topic

-sqlcheck

This ctutil option verifies that the data is correct in sqlized tables. The -sqlcheck option is used to verify that data in a file is compatible with SQL definitions. The command scans all records of the given file using the primary key index and stops at the first conversion error encountered showing an error message, the record number, schema and field name of the incorrect data.

Usage:

ctutil -sqlcheck file xdd_file [-conv=convention_ID] [-show=show_type]

The -sqlcheck option checks SQL definitions against data in a file. Valid parameters are:

  • file - File name without extension
  • xdd_file - Path to a data definition file in XML format
  • convention_ID - COBOL Users Only: Optional numeric storage convention ID; see convention_ID values.
  • show_type - level of errors to show:

    all - show all errors in the table

    first - show the first error in the table

    firstrec - show all errors in the first problematic record in the table

Example:

The usage and output of the command is as follows:

C:\>ctutil -sqlcheck filecompa filecompa.xdd -conv=A

ctutil Version 11.2.0.5893-160315

Initialized from (ctree.conf)

Checking filecompa...

ascii value is not a digit. Record#: 8 Schema#: 0 Field: NS

Operation completed successfully.

Example:

This example reveals numeric sign issues

>ctutil -sqlcheck CUSTOMER.DAT CUSTOMER.xdd -show=all

ctutil

Version 6.0.0.324-250123 - ACUCOBOL Edition

Initialized from 'ctree.conf'

Checking CUSTOMER.DAT...

Record#: 0000002 Schema#: 005 Field: keycharcnt Error: unexpected value for sign [8c] valid values [0d|0f] (last nibble only)

Record#: 0000002 Schema#: 005 Field: elecharcnt Error: unexpected value for sign [0c] valid values [0d|0f] (last nibble only)

Record#: 0000002 Schema#: 005 Field: maxelecnt Error: unexpected value for sign [0c] valid values [0d|0f] (last nibble only)

Record#: 0000008 Schema#: 005 Field: keycharcnt Error: unexpected value for sign [0c] valid values [0d|0f] (last nibble only)

Record#: 0000008 Schema#: 005 Field: elecharcnt Error: unexpected value for sign [0c] valid values [0d|0f] (last nibble only)

Record#: 0000008 Schema#: 005 Field: maxelecnt Error: unexpected value for sign [0c] valid values [0d|0f] (last nibble only)

Record#: 0000019 Schema#: 005 Field: keycharcnt Error: unexpected value for sign [0c] valid values [0d|0f] (last nibble only)

Record#: 0000019 Schema#: 005 Field: elecharcnt Error: unexpected value for sign [0c] valid values [0d|0f] (last nibble only)

Record#: 0000019 Schema#: 005 Field: maxelecnt Error: unexpected value for sign [0c] valid values [0d|0f] (last nibble only)

Operation completed successfully.

TOCIndex