This section explains the job delete API/EE (Mp_DeleteJob_Ex).
Synopsis
[Windows]
#include "f3cuapi.h" long Mp_DeleteJob_Ex (char *rhost, char *jobname, long jobno, char *jobhost, char *userforadmin, int system_num)
[UNIX]
#include "mjesapi.h " int Mp_DeleteJob_Ex (char *rhost, char *jobname, int jobno, char *jobhost, char *userforadmin, int system_num)
Description
This API deletes the job from the server where Systemwalker Operation Manager is installed. If the job is currently being executed, the execution is cancelled.
Parameters
rhost
Specify NULL here.
jobname
Specify the job name to be deleted. NULL can be specified. When NULL is specified, specify the job to be deleted with the job number specified in the jobno parameter.
jobno
Specify the job number of a job to be deleted. When specifying NULL in the jobname and when there are multiple jobs that have the same name, you must specify this parameter. If you specify jobname and there is no job with the same name, you can omit the job number. Specify 0 when omitting the job number.
jobhost
Specify NULL here.
userforadmin
Specify this parameter when a system administrator (users belonging to the Administrators group/ the superuser) deletes the users' jobs. Specify the owner of the deleted job. If the owner name is not specified, NULL should be specified.
system_num
Specify operating target subsystem number using a range of 0 to 9.
Return Values
Return Value | Meaning | Action |
---|---|---|
0 | The job was deleted normally. | - |
-1 | A system error occurred. | Collect "Job Execution Control" information with the maintenance information collection tool and contact a Fujitsu SE. |
-1000 or less | Deletion 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.
Program Example
Below is an example program of the job delete API/EE:
[Windows]
#include <windows.h> #include <stdio.h> #include "f3cuapi.h" int main (int argc, char **argv) { long jobno = 0; long rtn = 0; char errmsg[256+1]; int system_num; /* * initialization working area */ memset(errmsg, 0x00, sizeof(errmsg)); if (argc != 2) { printf ("Usage: %s <jobno>\n", argv[0]); return (1); } /* * set jobno */ jobno = atoi(argv[1]); /* * call Mp_DeleteJob_Ex() API */ system_num = 0; rtn = Mp_DeleteJob_Ex (NULL, NULL, jobno, NULL, NULL, system_num); /* * check return code of Mp_DeleteJob_Ex() API */ if (rtn == 0) { printf ("Job %d has been deleted.\n", jobno); return (0); } else if (rtn == -1) { printf ("GetLastError() is %d.\n", GetLastError()); } else if (rtn <= -1000) { printf ("Error code is %d.\n", rtn); Mp_GetMJESerror (errmsg); printf ("errmsg = %s\n", errmsg); } return (1); }
[UNIX]
#include <stdio.h> #include <errno.h> #include "mjesapi.h" int main (int argc, char **argv) { int jobno = 0; int rtn = 0; char errmsg[256+1]; int system_num; /* * initialization working area */ memset(errmsg, 0x00, sizeof(errmsg)); if (argc != 2) { printf ("Usage: %s <jobno>\n", argv[0]); return (1); } /* * set jobno */ jobno = atoi(argv[1]); /* * call Mp_DeleteJob_Ex() API */ system_num = 0; rtn = Mp_DeleteJob_Ex (NULL, NULL, jobno, NULL, NULL, system_num); /* * check return code of Mp_DeleteJob_Ex() API */ if (rtn == 0) { printf ("Job %d has been deleted.\n", jobno); return (0); } else if (rtn == -1) { printf ("errno is %d.\n", errno); } else if (rtn <= -1000) { printf ("Error code is %d.\n", rtn); Mp_GetMJESerror (errmsg); printf ("errmsg = %s\n", errmsg); } return (1); }