June 30, 2011
What About my COBOL Tables with Unusual Fields?
If you thought c‑tree was incredibly flexible in its table and record structures, you haven’t explored COBOL to its fullest. Why do you think they’re such a great match?! COBOL allows wide variations in tables, including multiple record formats as redefined records and fields. So what about those tables with unusual structures and definitions used with c‑treeACE SQL?
It’s possible some COBOL field content doesn’t match the equivalent c‑treeACE SQL field types resulting in conversion errors when executing SQL statements. However, with c‑treeACE SQL and c‑treeRTG COBOL Edition this is easy to discover. A specialized c‑treeACE SQL query statement can be run to determine those fields.
Take for example the following SQL statement which fails with a conversion error.
SELECT * FROM mytable WHERE f1='a'
A c‑treeACE SQL options clause can be added to the statement to determine the actual troublesome fields:
SELECT * FROM mytable WHERE f1='a' ctoption( badrec )
The ctoption ( badrec ) clause instructs the SQL engine to search for non-conforming data. The resultset will contain only records that fail to convert and the value for fields not converted will be NULL. Armed with this information, you can quickly identify which fields need exceptional handling.
c‑treeRTG COBOL Edition and c‑treeACE SQL were expressly designed for the flexibility inherent in COBOL development, much like c‑treeACE. A perfect match.