Topic
  • 1 reply
  • Latest Post - ‏2013-10-28T03:11:15Z by 67VE_Rahul_Pareek
67VE_Rahul_Pareek
67VE_Rahul_Pareek
2 Posts

Pinned topic COBOL XML GENERATE Error in DB2-COBOL Stored Procedure

‏2013-10-27T04:33:00Z |

Hi,

We're using DB2 V10. I need to pass the results of my COBOL-DB2 stored procedure as XML. The XML result-set will be a huge document and hence I cannot use VARCHAR variable to return the result. I am using an output parameter in the Stored Procedure to return the XML as CLOB. The XML file is generated using the XML-Generate statement and passing it back as XML through a CLOB variable. The CLOB

I have defined the XML output variable as follows:

01 WS-XML-DOC1 USAGE IS SQL TYPE IS XML AS CLOB(1024K).

This is my XML GENERATE statement:

INITIALIZE WS-XML-DOC1

XML GENERATE WS-XML-DOC1 FROM WS-OUTPUT-LAYOUT

COUNT IN WS-XML-DOC1-LENGTH

ON EXCEPTION

PERFORM P-XML-EXCEPTION THRU P-EXIT

 

However, while compiling the code I am getting the following error:

"XML GENERTATE" identifiers "WS-XML-DOC1(GROUP)" and "WS-XML-DOC1-LENGTH (BINARY INTEGER)" had over storage. This statement was discarded.

Any idea what is wrong I am doing here? As per the manuals this should be working.

  • 67VE_Rahul_Pareek
    67VE_Rahul_Pareek
    2 Posts

    Re: COBOL XML GENERATE Error in DB2-COBOL Stored Procedure

    ‏2013-10-28T03:11:15Z  

    Ok..this is solved. I had not define dthe WS-XML-DOC1-LENGTH variable.