Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2008
    Posts
    2

    Unanswered: 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

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •