Complex SQL, DIRECT YES


This example uses a subquery from another table, and date arithmetic.

Specifying DIRECT YES is not required as it is the default.

Information
Example
//UNLOAD   EXEC PGM=NGTUTIL,PARM='ssid,,NORESTART'          
//*                                                         
//UTPRINT   DD SYSOUT=*                                     
//SYSPRINT  DD SYSOUT=*                                     
//SYSTSPRT  DD SYSOUT=*                                     
//OBJREPRT  DD SYSOUT=*                                     
//*                                                         
//SYSIN     DD *                                           
 OUTPUT SYSREC  DSNAME hlq.OUTDATA.&TS..P&PART..T&TIME
 UNLOAD                                                   
   DIRECT YES                                             
      SELECT * FROM creator.table01                    
       WHERE COL01 IN                                     
         (SELECT col01 FROM creator.table02            
           WHERE col26 < CURRENT_DATE - 6 MONTHS)
/*


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Unload for Db2 13.1