Monday, September 26, 2011

DB2: Run SQL queries thru JCL - Batch SPUFI


Using the below job, you can run any SQL queries. The utility program DSNTEP2 is called as "batch SPUFI".

//STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=20                            
//STEPLIB DD DSN=DBDCSUP.DB2.DB0T.SDSNEXIT,DISP=SHR               
//        DD DSN=DBDCSUP.DB2.DB0T.SDSNLOAD,DISP=SHR               
//SYSPUNCH DD DUMMY                                                
//SYSTSPRT DD SYSOUT=*                                            
//SYSPRINT DD SYSOUT=*                                            
//SYSUDUMP DD SYSOUT=*                                            
//SYSIN DD *                                                       
 SELECT *
  FROM MYTEST.TAB;
 /*                                       
 //SYSTSIN DD *                           
 DSN SYSTEM(DB0T)                         
 RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) -     
 LIB('DBDCSUP.DB2.DB0T.RUNLIB.LOAD')      
 END                                      
 /*                                       
 //*                                      

No comments:

Post a Comment

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