Thanks for the input, I was looking for a way of telling that the subsytem
was ending controlled.

CEERTX()seems to do the same as the #pragma cancel_handler which Is great
for cleaning up, but doesn't seem to be called if the subsystem is being
ended controlled.

Anyway your posts led to QUSRJOBI which has the required flag:

int SubsystemRunning(void)
        Qwc_JOBI0600_t data;
        char job_name[26];
        char job_id[16];

    errcode.BYTESPRO = sizeof(errcode);

        memset(&data, ' ', sizeof(data));
        memset(job_name, ' ', sizeof(job_name));
        memset(job_id, ' ', sizeof(job_id));

        job_name[0] = '*';

        QUSRJOBI(&data, sizeof(data), "JOBI0600", job_name, job_id,
    if( errcode.BYTESAVL > 0 )
                perror( "Error Checking Subsystem Status: %s \n",errcode.EXCPID 

        if(data.End_Status[0] == '0')
                return(TRUE);/*Subsytem is Running*/

        return(FALSE);/*Subsystem is Ended*/

I find AS/400 programming information really difficult to track down,
especially C stuff (subset of a subset).  Thanks so much for providing about
the only decent resource.


Daniel Webb
Cobwebb Communications Ltd
+44 (0) 1732 812200

> -----Original Message-----
> From: []On
> Behalf Of Hall, Philip
> Sent: 15 March 2002 18:45
> To: ''
> Subject: RE: [C400-L] Monitoring for subsystem shutdown
> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
> --
> [ Picked text/plain from multipart/alternative ]
> > > Have you looked at the CEE api's CEE4RAGE & CEERTX ?
> >
> > CEERTX will.  There was recently a thread on this vary
> > topic in RPG-L.
> I thought as much - I have code using these API's, but I couldn't get to a
> 400 to test ending a subsys with my code running - thanks for verifying.
> --phil
> _______________________________________________
> This is the C programming iSeries / AS400 (C400-L) mailing list
> To post a message email:
> To subscribe, unsubscribe, or change list options,
> visit:
> or email:
> Before posting, please take a moment to review the archives
> at

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by 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].