您现在的位置是:首页 > 博文答疑 > DB2笔记系列 4 - Load and UNLOAD博文答疑

DB2笔记系列 4 - Load and UNLOAD

Leo2016-08-22【4】

简介DB2 Load and UNLOAD 这里只有简单的代码,让人可以直接从代码中学习

DB2 Load and UNLOAD 这里只有简单的代码,让人可以直接从代码中学习


            FIRSTNAME           CHAR(12) ,               

            LASTNAME            CHAR(12) )               

      ENFORCE NO                                         

//*                                                      

//LOADJCL   JOB ,'LOAD',NOTIFY=WANGLEI,                  

//             CLASS=C,MSGLEVEL=(1,1),MSGCLASS=X,PRTY=15 

//STEP1    EXEC DSNUPROC,SYSTEM=DSNS                     

//SYSRECAC DD DSN=OCB4B1.LOAD.TEST,DISP=SHR              

//SORTOUT DD DSN=IUIQU2UB.LOAD.STEP1.SORTOUT,            

//        DISP=OLD                                       

//SYSIN   DD *                                           

LOAD DATA INDDN(SYSRECAC) RESUME YES                     

     INTO TABLE WANGLEI.LOAD                             

           (EMPNO               CHAR(6)     ,            

//STEP1 EXEC DSNUPROC,UID=’IUIQU2UB.LOAD’,

// UTPROC=’’,

// SYSTEM=’V71A’

//SYSRECAC DD DSN=IUIQU2UB.LOAD.DATA,DISP=SHR,VOL=SER=SCR03,

// UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)

//SYSUT1 DD DSN=IUIQU2UB.LOAD.STEP1.SYSUT1,

// DISP=(MOD,DELETE,CATLG),

// UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)

//SOR

// DISP=(MOD,DELETE,CATLG),

TOUT DD DSN=IUIQU2UB.LOAD.STEP1.SORTOUT,

// UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)

//SYSIN DD *

LOAD DATA INDDN(SYSRECAC) RESUME YES

     INTO TABLE DSN8710.ACT

          (ACTNO POSITION( 1) INTEGER EXTERNAL(3),

           ACTKWD POSITION( 5) CHAR(6),

           ACTDESC POSITION(13) VARCHAR)

     ENFORCE NO

//*

//LOADJCL   JOB ,'LOAD',NOTIFY=WANGLEI,                

//             CLASS=C,MSGLEVEL=(1,1),MSGCLASS=X,PRTY=15

//STEP1    EXEC DSNUPROC,SYSTEM=DSNS                   

//SYSREC  DD DSN=OCB4B1.LOAD.TEST,DISP=SHR             

//SYSPUNCH DD DSN=IUIQU2UB.LOAD.STEP1.SORTOUT,         

//        DISP=OLD                                     

//SYSPRINT DD SYSOUT=*                                 

//SYSIN   DD *                                         

UNLOAD FROM   TABLE WANGLEI.LOAD                       

//*                                                    

//STEP1 EXEC DSNUPROC,UID=’SMPLUNLD’,UTPROC=’’,SYSTEM=’V71A’ //SYSREC DD DSN=USERID.SMPLUNLD.SYSREC,

// DISP=(NEW,CATLG,CATLG),

// UNIT=SYSDA,SPACE=(TRK,(2,1))

//SYSPUNCH DD DSN=USERID.SMPLUNLD.SYSPUNCH,

// DISP=(NEW,CATLG,CATLG),

// UNIT=SYSDA,SPACE=(TRK,(1,1))

//SYSPRINT DD SYSOUT=*

//SYSIN DD * UNLOAD TABLESPACE DSN8D71A.DSN8S71E FROM TABLE DSN8710.EMP WHEN (WORKDEPT = ’D11’ AND SALARY > 25000)

//JOBLOAD JOB (CC),                                                    00010000

//             'HRAIACRL',                                              00011000

//             CLASS=4,                                                 00012000

//             MSGCLASS=V,                                              00013000

//             MSGLEVEL=(1,1),                                          00014000

//             NOTIFY=&SYSUID                                           00015001

//* LOAD IACRR                                                          00016000

//********************************************************************* 00033000

//*                                                                     00034000

//*                                                                     00036000

//*                                                                     00054000

//STEP030 EXEC PGM=DSNUTILB,                                            00055000

//             PARM='DB2U,HRAIACR,RESTART(PHASE)',                      00056000

//             REGION=4096K                                             00057000

//*                                                                     00058000

//*                                                                     00076000

//STEPLIB   DD DISP=SHR,                                                00077000

//             DSN=SYS1.DSNDB2U.SDSNLOAD                                00078000

//*                                                                     00097000

//SYSPRINT  DD SYSOUT=*                                                 00098000

//*                                                                     00117000

//UTPRINT   DD SYSOUT=*                                                 00118000

//*                                                                     00119000

//*                                                                     00125000

//SYSREC00  DD DISP=SHR,DSN=WISCO31.TEST01.D091011                      00126000

//*                                                                     00138000

//SYSUT1    DD DISP=(MOD,DELETE,DELETE),                                00139000

//             DSN=THRA.ANZD.SYSUT1,                                    00140000

//             SPACE=(CYL,(5,5),RLSE),                                  00141000

//             UNIT=SYSDA                                               00142000

//*                                                                     00143000

//*                                                                     00149000

//SORTOUT   DD DISP=(MOD,DELETE,DELETE),                                00150000

//             DSN=TPPX.ANZD.SORTOU,                                    00151000

//             SPACE=(CYL,(5,5),RLSE),                                  00152000

//             UNIT=SYSDA                                               00153000

//*                                                                     00154000

//SORTWK01  DD DISP=(MOD,DELETE,DELETE),                                00155000

//             DSN=TPPX.ANZD.SORTWK01,                                  00156000

//             SPACE=(CYL,(5,5),RLSE),                                  00157000

//             UNIT=SYSDA                                               00158000

//*                                                                     00159000

//*                                                                     00205000

//*                                                                     00211000

//SYSIN     DD *                                                        00212000

      LOAD DATA                                                         00212100

   INDDN SYSREC00  REPLACE                                              00212201

  INTO TABLE DBDHRAAU.HRATIACR                                          00212500

  (                                                                     00212600

  PAYITEM                                                               00212700

       POSITION (     1  )         CHAR (     3 )                       00212800

   ,                                                                    00212900

  DESCRIPTION                                                           00213000

       POSITION (     4  )         CHAR (    45 )                       00213100

   ,                                                                    00213200

  PAYITEM_TYPE                                                          00213302

       POSITION (     49 )         CHAR (    1 )                        00213400

   ,                                                                    00213500

  REPORTING_IND                                                         00213602

       POSITION (     50 )         CHAR (     1 )                       00213700

   ,                                                                    00213800

  EXTRACT                                                               00213900

       POSITION (    51  )         CHAR (     1 )                       00214000

   ,                                                                    00214100

  ESPP                                                                  00214200

       POSITION (    52  )         CHAR (     1 )                       00214300

  )                                                                     00216900

  REPAIR SET TABLESPACE HRAD02AU.HRASIACR NOCOPYPEND                    00217000

//*                                                                     00218000

//*                                                                     00221000