COBOL Copybooks overview

Use COBOL Copybooks in HCL OneTest™ API to test COBOL data files or the applications that produce and consume them.

You can add COBOL Copybooks to HCL OneTest API and apply them to messages. Copybooks provide a format that is meaningful to the system under test.

Cobol data files do not contain information about their own organization and record structure. If you have a COBOL data file, but no program capable of writing or reading this file, you cannot correctly interpret the data that the file contains.

The information that describes the physical layout of program data, that is, how the records and fields relate to each other, is stored in a Copybook file. This file is included in all of the applications that process the file.

COBOL copybook files are named with .cbl, .ccp, .cob and .cpy extensions, and typically include one or more level 01 structures. These structures can be made available within HCL OneTest API as message schemas that can be used to create or parse the data in files or messages.

COBOL Copybook schemas can be applied to any of the following fields:
  • Byte array fields, in messages where you can use the Byte Array formatter
  • Bytes message types, set within the message body when you are using any of the JMS providers
  • Text messages, which you can format based on the applied schema.
COBOL Copybook schemas have the following limitations:
  • No support for COPY statements
  • No support for COMP-4 or COMP-5 types
  • All types are represented as strings within HCL OneTest API
  • Formatting characters (signs) are included in fields that the user works with
  • No repeating node support for fields defined by OCCURS clauses

You can overcome many of these limitations by importing the COBOL Copybook as a DFDL schema. See Importing a COBOL copybook as a DFDL schema.