IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Inserting value in DB2 BLOB field using file reference var


IBM Mainframe Forums -> DB2
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
Swati Shah

New User


Joined: 24 Mar 2010
Posts: 1
Location: India

PostPosted: Wed Nov 10, 2010 3:03 pm
Reply with quote

Hi,

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

EXEC SQL
INSERT INTO REPORT-TABLE
VALUES (:WW-REPORT)
END-EXEC


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.

Thanks.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Nov 10, 2010 8:29 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Mr Swann

New User


Joined: 09 Jul 2020
Posts: 6
Location: France

PostPosted: Wed Jul 29, 2020 11:57 am
Reply with quote

Hello , just in case you can find usefull informations here ..

ibmmainframes.com/viewtopic.php?p=350035#350035
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Wed Jul 29, 2020 1:11 pm
Reply with quote

After 10 years I think the problem has been resolved. Please do not revive old topics.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Help required to reset decimal points... DFSORT/ICETOOL 10
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts Sorting Date Field DFSORT/ICETOOL 4
No new posts how to eliminate null indicator value... DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
Search our Forums:

Back to Top