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,
(char*)&errcode);
    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.

Regards

Daniel Webb
Cobwebb Communications Ltd
http://www.cobwebb.com
+44 (0) 1732 812200

> -----Original Message-----
> From: c400-l-admin@midrange.com [mailto:c400-l-admin@midrange.com]On
> Behalf Of Hall, Philip
> Sent: 15 March 2002 18:45
> To: 'c400-l@midrange.com'
> 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: C400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/c400-l
> or email: C400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/c400-l.



This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2019 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 here. If you have questions about this, please contact [javascript protected email address].