Monday, September 26, 2011

DB2: Sample LOAD job using ADMF utility DSNUTILB


The below job deletes all the records from a table and loads the input data into the table and updates the table statistics and index statistics.

Explanation of parameters present in the control card

REPLACE - Instructs DB2 to drop all the existing rows from the table.
LOG NO - instructs DB2 to not to perform logging
NOCOPYPEND - instructs DB2 not to put the table in the copy pending status.
STATISTICS - instructs DB2 to update the statistics of table as well as index.

//STEP010  EXEC PGM=DSNUTILB,REGION=0M,                                
//            PARM='DB0T,LOADDATA'                                      
//STEPLIB  DD DSN=DB2.DBXT.SDSNEXIT,DISP=SHR
//         DD DSN=DB2.DBXT.SDSNLOAD,DISP=SHR                           

//SYSIN    DD *
LOAD DATA                                      
 REPLACE  LOG NO  NOCOPYPEND  
 STATISTICS TABLE INDEX UPDATE ALL             
INTO TABLE MY.TABLE
(                                              
FIELD1                                     
     POSITION (     1  )         CHAR (     3 )
 ,                                             
FIELD2                                
     POSITION (     4  )         CHAR (     1 )
)
//*
// DISP=SHR
//SYSDISC  DD DSN=…
//            DISP=(,CATLG),SPACE=(CYL,(9,9),RLSE)                     
//SYSMAP   DD DSN=…
//            DISP=(,CATLG),SPACE=(CYL,(9,9),RLSE)                     
//SYSDISC  DD DSN=…
//            DISP=(,CATLG),SPACE=(CYL,(9,9),RLSE)                     
//SYSUT1   DD DSN=…
//            DISP=(,CATLG),SPACE=(CYL,(9,9),RLSE)                     
//SORTOUT  DD DSN=…
//            DISP=(,CATLG),SPACE=(CYL,(9,9),RLSE)                     
//SORTWK01 DD SPACE=(CYL,(100,100))                   
//SORTWK02 DD SPACE=(CYL,(100,100))                   
//SORTWK03 DD SPACE=(CYL,(100,100))           
//SORTWK04 DD SPACE=(CYL,(100,100))           
//SYSPRINT DD SYSOUT=*                                         
//UTPRINT  DD SYSOUT=*                                         
//SYSREC   DD DSN=input dataset having the data to be loaded..

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.