Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Inserting value in DB2 BLOB field using file reference var

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Inserting value in DB2 BLOB field using file reference var
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

Site Director


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

PostPosted: Wed Nov 10, 2010 8:29 pm    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 1 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us