Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert of a CLOB in Cobol

Status
Not open for further replies.

MarcLodge

Programmer
Feb 26, 2002
1,886
GB
Does anybody have an example of an insert into a CLOB column in a Cobol program. I've had a Google, and I found LOBLOC.SQB on the IBM website, but I'm having trouble with it as it does not do an insert.

Marc

Ps. Have posted this in the DB2 forum too
 
Please ignore as I have managed to resolve.

Marc
 
Alas, the problem I was attempting to resolve still exists.....

I have a DB2 table with a CLOB column. When I insert to this column, the data is truncated. I've used CLOBs and CLOB locators all to no avail. The data gets truncated at around 3500 bytes, but the size of the CLOB is 200,000 bytes. The table page size is 32K so there doesn't seem to be any reason for this truncation.

I'd still be happy to see anybody else's code of an insert to a CLOB column, and also hear of any similar troubles that people may have had with this data type.

FYI, I am posting in the DB2 forum also.

Regards,

Marc
 
do you use
Code:
01  BLOB      USAGE IS SQL   TYPE IS BLOB(200K). 
01  BLOB-NULL USAGE IS BINARY       PIC S9(004).
as host-vars?
Another pitfall: using S9(4) COMP as subscript could be too small. Rather use s9(9) COMP's to be sure.
 
I'll close this thread as I don't think it's a strict Cobol or a DB2 issue, more a developer error.

Frederico asked me for a copy of the program, so I cut down and tidied up the original just leaving the insert so that I could send it to him. As I then had a version of the program that just did the insert I compiled and ran it. And it worked fine!

I'm going to either pass the program back to the original developer in order to debug or do it myself.

Many thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top