|
Hi Ken, <snip> BUT ... this method means that you have to have authority to use commands that generally are going to be *PUBLIC *EXCLUDE. And to use the STRSRVJOB command: To use this command, you must be signed on as QPGMR, QSYSOPR, QSRV, or QSRVBAS, or have use (*USE) authority to the user profile of the job being serviced. I could run this on our development system but not on our production system. </snip> You're right. I have authority to service jobs on our production machines so it's not a problem for me. I'm not suggesting a difinitive solution here. I'm just posting some code I knocked up in a couple of hours that has served me very well in the past. <snip> And a traceable event has to occur to trigger the exit program, which the break-handling program method does not require. </snip> Again, right. But for me: When I'm debugging a job that I'm servicing, I can simply press F21 to get a command line. I can then issue the SNDJOBCMD from the command line. When I F12 from the command line back to the debugger - guess what? Yep, that was a traceable event and my command has just run. So I can sit on the same break point and issue as many commands as I like because every time I access the command line from the debugger and return to it I create an event that can be traced. <snip> My other comment ... when you said that you could easily access another job's QTEMP, that wasn't really true. Like the break-handling program method, you are getting that job to access its own QTEMP on your behalf, which isn't quite the same thing. </snip> Well I guess that all depends upon your definition of "access". I have access to my money, but I don't go into the bank vault to get it. The fact that the money dispensed to me by the ATM is not the actual money placed into my account is immaterial. The balance shows an amount and I can withdraw on it. The same holds true here - if I can delete an object in the QTEMP library of another job, I think you'll agree that the object is most definitely deleted. How I managed to do it does not come into the equation - but you must concede that I had some form of access to it. :-) I could imagine there are much sweeter ways of doing this, and I concede to you that it is a simple hack and not an elegant API that truly accesses the QTEMP objects in a way we would consider "real" access. But hey, it's free. If it's useful to one other programmer then it's worth sharing. For sweet you want to see my SQL2XML service program, now that's a nice piece of kit! SQL queries on multiple files to generate any XML you like. All using QSQPRCED so no need for the SQL precompiler. But, as it's a WIP, that's for another thread... :-) Cheers Larry
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.