I am running COBOL-DB2 batch (version 7.0 DB2) in Z/OS -OS390.
I see very little documentation - in particular, illustrative examples, of the DESCRIBE TABLE syntax and what exactly gets populated to the SQLDA when the command is issued.
In the following example (simplified from my current program which is failing), I have the following code:
(assume table: ABCD.TABLEAA has 50 columns)
EXEC SQL
INCLUDE SQLDA
END-EXEC.
MOVE 'ABCD.TABLEAA' TO WS-HOST-TABLE
EXEC SQL
DESCRIBE TABLE :WS-HOST-TABLE INTO

QLDA
END-EXEC.
DISPLAY 'NUM OF COLUMNS: ' SQLD
PERFORM VARYING WS-SUB1 FROM 1 BY 1
UNTIL WS-SUB1 > SQLD
DISPLAY 'COL NAME: ' SQLNAME (WS-SUB1)
END-PERFORM.
************************************************** ***
In the above example, SQLD is accurately displaying 50 as the true number of columns. However, every occurence of SQLNAME is coming up with low-values. I have checked for bugs in the code but I cannot spot any. Does anyone see the cause of my failure ?
regards and thanks in advance
dcshnier