search cancel

java.lang.StringIndexOutOfBoundsException error when parsing the Copybook

book

Article ID: 230017

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

While attempting to work with some complex copybook conditions, when the File definition manager tries to create the AFL files we are getting the following parsing error:

java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Environment

Release : 4.9.1

Component : Mainframe

Cause

Generally, this exception indicates that a string either meets or exceeds a defined character length limitation. 

According to the TDM Solutions Architects, there is a 30-character max limit that comes from the language standard (Cobol, PL/I).

Another thing to consider is if the copybook source contained any non-language elements, like ASA control characters. If so, removing the control character when shortening the record/field names, may correct the problem.

Resolution

The customer confirmed that they have some 'record names' and 'field names' which exceed 30 characters. After shortening the 'record names' and 'field names', the Copybook parses and the AFL is generated without error.