If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Need samle JCL Unload/load utility for Db2 table having a clob column

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-14-08, 03:38
narayananv narayananv is offline
Registered User
 
Join Date: Mar 2008
Posts: 2
Need samle JCL Unload/load utility for Db2 table having a clob column

Need samle JCL Unload/load utility for Db2 table having a clob column.

I run into issues inolving tablespaces when I am execute a simple Unload command.

From IBM Manual:
TEMPLATE TSYSPUN
DSN('PAOLOR2.&SS..&DB..&SN..UNLOAD.PUNCH6')
DISP(MOD,CATLG,CATLG)
TEMPLATE TSYSREC
DSN('PAOLOR2.&SS..&DB..&SN..UNLOAD.SYSRC6')
DISP(MOD,CATLG,CATLG)
TEMPLATE TSYSLOB
DSN('PAOLOR2.&SS..&DB..&SN..UNLOAD.PDS6')
DISP(MOD,CATLG,CATLG)
DSNTYPE(PDS)
UNLOAD DATA FROM TABLE ##T.NORMEN00
(DOC_ID,FORMAT,IMAGE VARCHAR(54) BLOBF TSYSLOB)
UNLDDN(TSYSREC) PUNCHDDN(TSYSPUN)

Can someone tell me-what TEMPLATE means here and how it needs to be created.

Thanks
Reply With Quote
  #2 (permalink)  
Old 03-14-08, 09:48
tibullo tibullo is offline
Registered User
 
Join Date: Dec 2004
Location: Italy
Posts: 32
I would use a different approach, using a load cursor after you have created the new table with the same structure as the old one.

If DocId is an identity column you shouldn't include it in your declaration.

//LDAD01 EXEC LOADPROC,PARM='DB2X,LOADCLOB'
//STEPLIB DD DSN=DSN710.SDSNLOAD,DISP=SHR
//SYSPUNCH DD DUMMY
//SORTWK01 DD DSN=&&SRTWK01,UNIT=3390
//SORTWK02 DD DSN=&&SRTWK02,UNIT=3390
//SORTWK03 DD DSN=&&SRTWK03,UNIT=3390
//SORTWK04 DD DSN=&&SRTWK04,UNIT=3390
//SYSIN DD *
EXEC SQL
DECLARE C1 CURSOR FOR SELECT
DOC_ID,
FORMAT,
IMAGE
FROM ##T.NORMEN00
ENDEXEC
LOAD DATA INCURSOR(C1) REPLACE LOG NO NOCOPYPEND
INTO TABLE ##T.NEWTABLE
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On