Consider setting an exit program for the STRSQL command against the QIBM_QCA_RTV_COMMAND exit point. (Or possibly the QIBM_QCA_CHG_COMMAND exit point.) When your exit program is called, run STRDBMON for the job. The DB monitor will end when the job ends.
You might want to mark the fact that the DB monitor had already been started within the job so you don’t try to start it multiple times for times when STRSQL is run again in the same job. Maybe create a job environment variable in case you want to check its existence later in the job. Or you can simply handle a CPF436C (I think) message if it gets sent.
It’s less easy to know when to turn the DB monitor off. It shouldn’t hurt much to leave it on for as long as that job runs, but it will continue collecting information after STRSQL is exited. You can ignore or remove extra records later.
Otherwise, you might need to front-end STRSQL with your own process. Start and end the DB monitor directly in that process instead of in the exit program. You’d then want the exit program to handle cases where the command was somehow being accessed outside of your wrapper.