I have a requirement to upload the report created through COBOL program, stored in a PS file on mainframe, to BLOB field of DB2 table.
I tried it using file refernce variable and wrote below code.
WW-REPORT USAGE SQL TYPE IS BLOB-FILE.
MOVE 'ABC.TEST.PS' TO WW-REPORT-NAME
MOVE 11 TO WW-REPORT-NAME-LENGTH
MOVE 80 TO WW-REPORT-DATA-LENGTH
MOVE SQL-FILE-READ TO WW-REPORT-FILE-OPTION
INSERT INTO REPORT-TABLE
It is failing with SQLCODE -452 with reason code as 1. which means file length or file format is incorrect.
I don't see any issue with file length I have passed. File is fixed block PS file on mainframe.
Please suggest possbile problem here.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
Hello and welcome to the forum,
Suggest you talk with whoever gave this "requirement". . .
If there is a multi-record report file in a ps and the goal is to insert the entire report into the table as a blob, something will have to create a "binary object" from the sequential report. It will not be done by inserting the report lines directly.
One way this is sometines done is to pass the report thru some utility that will convert the report to a pdf and then the pdf is inserted as a blob. If your system does not already have such a utility in place, i suspect this will not be an option.