|
Jeff, > > Well, on the AS/400 a simular type thing might be a endjob() issued > by the system operator, or a support specialist. However, I can not get > the ILE/C program to regognize the event in anyway, no matter how long I set > the delay on the cancel, or rather it is the job or sus-system that I > cancel. I've hit this one too, signal doesn't get the SIGABRT. But try the 'Call Stack Entry Termination Exit Procedure' API; #include <stdio.h> #include <stdlib.h> #include <string.h> #include <leenv.h> void program_ending(_POINTER *user_token); int main(void) { _RTX_ENTRY term_proc = program_ending; _FEEDBACK fc; /*-- register call stack exit --*/ CEERTX(&term_proc, NULL, &fc); /*-- do something here and if ENDJOB is used while we wait for the DLYJOB to time-out 'program_ending' will be called. --*/ system("DLYJOB DLY(120)"); /*-- if we get here, without ENDJOB, then program_ending won't be called --*/ return 0; } void program_ending(_POINTER *user_token) { printf("Term proc was called\n\n"); /*-- unregister call stack exit --*/ CEEUTX(&term_proc, &fc); } If the operator does a endjob or an endjob option(*immed) then the function 'program_ending' will get called. The only problem with this is that it's for the *current* call stack entry (ie itself) not the whole job. Might want to look at the 'Activation Group Exit Procedure' CEE4RAGE (nice name ;-) API, which you could probably set up to cover the whole job (if it runs in *one* actgrp). Anyhow, with these two API's you could probably achieve what you want. HTH. -phil -- Phil Hall ____________________________ email . . . : hallp@ssax.com phone(w). . : (312) 258-6319 +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to "MIDRANGE-L@midrange.com". | To unsubscribe from this list send email to MAJORDOMO@midrange.com | and specify 'unsubscribe MIDRANGE-L' in the body of your message. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.