1. In your ISPF skeleton data set write the JCL to send mail and include the skeleton JCL in your REXX program
2. IN the main rexx program invoke Db2 services and display the log. collect the response in a stem variable and read it till your are able to get % character. ( the reason for this is that , the log message would generally say something like 'db2.log. dataset' is x% FULL)
3. try to seaprate out x
4. when x is greater than say a Y percentage , submit the JCL which sends mail through REXX comands.