Unloading by using a table lookup


It is sometimes useful to select the rows to unload by determining if the rows exist in another table (for example, if you have a production application that identifies rows to be unloaded over the weekend for later transfer to a non-Db2 application).

Example
//SYSIN DD *
         UNLOAD DATA FORMAT(DSNTIAUL) UNLOADDN(SYSREC)
         SELECT *
         FROM BMC.PRODUCTION_TBL
         WHERE RECID IN (SELECT RECID FROM ROWS2UNLD)

Related topic



 

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