× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Another way to check for a controlled end is the Retrieve Current Attributes
(QWCRTVCA) API using the RTVC0100 format with the End status key (0502).
This returns a '1' if the system, subsystem, or job has been cancelled or a
'0' if not.  This is the same as the status returned for RTVJOBA
ENDSTS(&STATUS).


-----Original Message-----
From: Daniel Webb [mailto:daniel@cobwebb.co.uk]
Sent: Monday, March 18, 2002 7:05 AM
To: c400-l@midrange.com
Subject: RE: [C400-L] Monitoring for subsystem shutdown


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 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.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

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.