Top
Systemwalker Operation Manager  Reference Guide
FUJITSU Software

16.3.16 Queue List Information Acquisition API [Windows]

This section explains the queue list information acquisition API (Mp_ListQueue).

Synopsis

#include "f3cuapi.h"
long Mp_ListQueue (char *rhost,
                      long mode,
                      struct Mp_QUEUEINF_1 *queueinf[ ])

Description

This API obtains the list of queue information.

Parameters

rhost

Specify NULL here.

mode

Specify one of the following process modes. After GETQST, you must always specify FREEQST.

GETQST:

Obtains the queue list information.

FREEQST:

Frees the area that was used for the queue list information obtained by GETQST.

queueinf[ ]

GETQST:

Specify the address to which the address of the queue information structure (Mp_QUEUEINF_1) will be notified.

FREEQST:

Specify the area address to which the address of the job information structure's array was notified in GETQST. Between the issuing GETQUE and FREEQST, you should not change the contents of the area.

Return Values

Return Value

Meaning

Action

1 or greater

This indicates that the queue information list was obtained normally and the number of queues is returned.

-

-1

A system error occurred.

Collect "Job Execution Control" information with the maintenance information collection tool and contact a Fujitsu SE.

-1000 or less

Processing was aborted because an error was detected in Job Execution Control. Error messages can be obtained using the error message acquisition API.

Use the error message acquisition API to obtain the error message and take whatever action is required.

Caution

When the argument is pointing to an invalid address, this function ends abnormally, and no operations will be defined.

Format of the Queue Information Structure (Mp_QUEUEINF_1)

The following is the format of the queue information structure:

This structure is defined in the INCLUDE file f3cuapi.h".

typedef struct _Mp_QUEUEINF_1 {
  char      queuename[];               /*queue name                               */
  long      queuetype;                 /*queue type                               */
  char      status;                    /*queue status                             */
  long      maxjob;                    /*maximum possible job submission quantity */
  long      maxexec;                   /*maximum possible job execution quantity  */
  long      elapsed;                   /*maximum time lapse limit (seconds)       */
  long      dfltprty;                  /*default priority order                   */
  long      dfltdprty;                 /*default priority                         */
  long      job_wait;                  /*jobs waiting to be executed              */
  long      job_hold;                  /*jobs on hold                             */
  long      job_run;                   /*jobs in execution                        */
  char      hostgrp[];                 /*distributed host group name              */

} Mp_QUEUEINF_1 

Following provides the explanations about each item.

queuename

The queue name is set.

queuetype

The queue type is set. The following types can be set for a queue:

Value

Type

1

Local queue

2

Distributed execution queue

status

The queue status is set. The following statuses can be set for a queue:

Value

Status

1

Operating

2

Paused

maxjob

The maximum number of possible jobs to be submitted is set.

maxexec

The maximum number of possible jobs to be executed is set.

elapsed

The maximum time lapse limit is set in seconds.

dfltprty

The default priority order is set.

dfltdprty

The default priority is set.

job_wait

The number of jobs waiting to be executed at the moment when the API was called up is set.

job_hold

The number of jobs held at the moment when the API was called is set.

job_run

The number of jobs being executed at the moment when the API was called is set.

hostgrp

The distributed host group name is set. NULL is set when it is a local queue.

Program Example

Below is an example program of the queue list information acquisition API:

#include <windows.h>
#include <stdio.h>
#include "f3cuapi.h"

int main (int argc, char **argv)
{

        Mp_QUEUEINF_1 *queinf = 0;
        Mp_QUEUEINF_1 *qinf = 0;

        long mode;
        long idx;
        long rtn = 0;
        char errmsg[256+1]; 

        /*
         * initialization working area
         */ 
        memset(errmsg, 0x00, sizeof(errmsg)); 

        mode = GETQST;
        /*
         *  call Mp_ListQueue() API 
         */ 
        rtn = Mp_ListQueue (NULL, mode, &queinf); 

        /*
         * check return code of Mp_ListQueue() API
         */ 
        if (rtn == -1){
                printf ("GetLastError() is %d.\n", GetLastError()); 
                return (1); 
        } else if (rtn <= -1000) {
                printf ("Error code is %d.\n", rtn);
                Mp_GetMJESerror (errmsg); 
                printf ("errmsg = %s\n", errmsg); 
                return (1); 
        }

        qinf = queinf;

        printf("queue name      wait  hold  run   status\n");
        for (idx = 0; idx < rtn; idx++) {

                printf("%15.15s %5.5d %5.5d %5.5d ",
                        qinf->queuename, qinf->job_wait, qinf->job_hold, qinf->job_run);
                switch(qinf->status){
                case 1  : 
                        printf("active  "); 
                        break;
                case 0  : 
                default : 
                        printf("inactive"); 
                        break;
                }
                printf("\n"); 
                qinf++;

        }

        mode = FREEQST; 

        /*
         *  call Mp_ListQueue() API 
         */ 
        Mp_ListQueue (NULL, mode, &queinf); 

        return(0);

}