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

Handling BLOB data in COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
VIKRAM KUMAR MISHRA

New User


Joined: 24 Dec 2012
Posts: 3
Location: India

PostPosted: Wed Aug 13, 2014 1:00 am
Reply with quote

My requirement is to read a table data with a BLOB column > 32K length and store it in a file and then reload the file back to the table using DB2 load utility.

I know that while we unload BLOB data using DB2 utility through JCL, we provide a PDS for BLOB and a PS for rest of data. The PS file will have a reference to PDS file and member for the row to be loaded. This PS when used to load will automatically load BLOB data to table.

I need to understand if I can use same concept through cobol. That is to create a PS file with all data and reference to a PDS file. The PDS file will be created in COBOL with n number of members and store the BLOB data. Then define SYSPUNCH accordingly and use the PS file to load.

Will this concept work or is there some other concept. Also if this way it can work then how to know how many members to be created in PDS. How to specify multiple members in PS for a single row of data. I could not find any documentation.

Please help.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2790
Location: NYC,USA

PostPosted: Wed Aug 13, 2014 9:15 pm
Reply with quote

Why would you like to reinvent another wheel when we you know this can be done through utility? Do you have any reason?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2790
Location: NYC,USA

PostPosted: Wed Aug 13, 2014 9:32 pm
Reply with quote

However, please refer to below link which might be helpful to what you have asked,
www-01.ibm.com/support/knowledgecenter/#!/ssw_ibm_i_71/rzajp/rzajpcoblob.htm

Note:If you want the data to be in readable format then,you should define it as a CLOB. A BLOB is for binary data and a CLOB is for character data.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Aug 14, 2014 7:19 pm
Reply with quote

Hi,

You may have to consider spanning records in multiple lines as length of a file cannot be greater than 32K.

DB2 load utility uses a option SPANNED YES but the file format is VBS and cannot be edited. (No need to have PDS members now).
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:59 am
Reply with quote

Rohit Umarjikar wrote:
Why would you like to reinvent another wheel when we you know this can be done through utility? Do you have any reason?



For instance I have a unload file

and I want to use SQL INSERT coded in COBLOL (instead if reload )

to put it into another DB2

solution described here ..

ibmmainframes.com/viewtopic.php?p=350035#350035
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts IDCAMS listcat service using cobol JCL & VSAM 1
No new posts Make cobol variable value a variable COBOL Programming 3
No new posts how to convert and use 1 bit hex-numb... COBOL Programming 10
No new posts VB file copy COBOL program gives erro... COBOL Programming 3
No new posts Adding a header when change data DFSORT/ICETOOL 6
Search our Forums:

Back to Top