Highlighted
Absent Member.
Absent Member.
882 views

[archive] comp-6 date field errors in sql

[Migrated content. Thread originally posted on 03 December 2010]

We are querying vision files thru acuxdbc 8.1 with ms sql 2008. When we try to query a date field (xfd directive defines as a date field MMDDYY, in fd it is pic 9(06) comp-6) we receive an error such as:

"An error occurred while executing batch. Error message is: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."

if the date field has a value of zero. (The zero value is valid in cobol world.) If the field was non-comp, just a pic 9(06), there would be no problem - sql would just pull in as a null. If we were to rewrite the entire cobol data file using non-comp data for any date field that might have a zero in it, the problem does resolve - sql pulls in as a null. The problem with that is we have a huge file and hundreds of programs that would have to be recompiled.

Has anyone else had this problem or any ideas on how to resolve? :confused:
0 Likes
1 Reply
Highlighted
Absent Member.
Absent Member.

RE: [archive] comp-6 date field errors in sql

seems to me that if you set the datatype directive flag on those fields defined with the COMP-6 as Alpha then it works...

We use acubench so in the XFD tab find the field and check the Data Type Directive box, then select alpha. Thin in your fd you get the bench tag *(( XFD ALPHA )) right before the field entry.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.