Monday, September 26, 2011

DB2: Unload data using DSNTIAUL program - Sample job


We can use DSNTIAUL program to unload data from DB2 tables into sequetial datasets. The output dataset can be used  as input to the load utility. The sample job is below.

//STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=20                       
//SYSTSPRT DD SYSOUT=*                                       
//SYSTSIN DD *                                               
 DSN SYSTEM(DB0T)                                             
 RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL') -         
 LIB('DBDCSUP.DB2.DB0T.RUNLIB.LOAD')                         
//SYSPRINT DD  SYSOUT=*                                      
//SYSPUNCH DD  SYSOUT=*                                       
//SYSREC00 DD  DSN=SS9331.SYSA.DRC.D110729,                  
//         DISP=(NEW,CATLG,DELETE),                          
//         SPACE=(CYL,(5,10),RLSE)                           
//SYSIN    DD  *                                             
     SELECT * FROM MY.TAB
     WHERE AUDNBR >= 15977327;
//*                          

No comments:

Post a Comment

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