Monday, September 26, 2011

DB2: Sample job to insert the rows in the existing table


"RESUME YES" parameter in the control card instructs the utility to insert the records from the input dataset into the table.

//STEP010  EXEC PGM=DSNUTILB,REGION=0M,                                
//            PARM='DBXT,LOAD'                                      
//STEPLIB  DD DSN=DB2.DBXT.SDSNEXIT,DISP=SHR
//         DD DSN=DB2.DBXT.SDSNLOAD,DISP=SHR                           
//SYSIN    DD *
LOAD DATA                                      
 RESUME YES  LOG NO  NOCOPYPEND  
INTO TABLE MY.TABLE
(                                              
FIELD1                                     
     POSITION (     1  )         CHAR (     3 )
 ,                                             
FIELD2                                
     POSITION (     4  )         CHAR (     1 )
)
//*
//SYSREC   DD DSN=input dataset having the data to be loaded..
// 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=*                                         

No comments:

Post a Comment

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