Top
Systemwalker Operation Manager  Reference Guide
FUJITSU Software

18.2 Job Net Abended Extended Exit

This section explains the exit program called when job nets end with Abended or Canceled.

[Windows]

If the job net ends in Abended or Canceled, the system searches for the jobschexitex.bat file first, and then the jobschexitex.exefile as the exit program. The exit program found in the search will be called up. If jobschexitex.bat is found, jobschexitex.exe will not be called up even if it exists.

If you want to use this exit to perform custom processing, create an exit program with the same name and store it in the following directory:

<Systemwalker installation directory>\MpWalker.JM\bin

[UNIX]

If the job net ends in Abended or Canceled, the system searches for and calls the jobschex.exit file as the exit program.

If you want to use this exit to perform custom processing, create an exit program with the same name and store it in the following directory:

Solaris/Linux:

/opt/FJSVJOBSC/bin

HP-UX:

/opt/FHPJOBSCH/bin

AIX:

/usr/FAIXJOBSC/bin

Appropriate execution privileges are required to execute the exit program. If relevant privileges are not set, the exit program will not be called.

The job net abended extended exit differs from the job net abended exit. This means if the job net of Job Execution Control attribute ends with Abended, the completion code passed to the exit program is the same with the value returned from Job Execution Control.

Parameters Passed to the Exit Program

The parameters passed to the exit program are as follows:

argc:

Number of parameters (20)

argv[0]:

Exit program name

argv[1]:

Name of project where the job net is registered

argv[2]:

Job net name

argv[3]:

Job net comment

argv[4]:

Name of group to which job net belongs

However, if it does not belong to any group, the parameter is set as ""

argv[5]:

Maximum value of job completion code in the job net

If it is the job net of Job Execution Control attribute, it may exceed 256

However, it is 256 if the job net has been canceled, and it becomes 239 if interrupted.

argv[6]:

Job net start time

The format is "year month/date hour:minute:second".

argv[7]:

Job net end time

The format is "year month/date hour:minute:second".

argv[8]:

Number of jobs in job net (character string)

argv[9]:

Temporary file name

argv[10]:

For SE version, set as "", and for EE version, set with subsystem number.

argv[11 to 19]:

Reserved ("")

Information on each job in the job net is stored in the temporary file as shown below. The job name, completion code, and status are stored for each job.

Job name
Completion code
Status
Job name
Completion code
Status
..........
Job name
Completion code
Status

The following explanations describe each of the types of information shown above:

Job name:

Depending on execution attributes, the following contents are stored:

When the execution attribute is "Job Execution Control":

This is a job name. If the job name is omitted, the string registered as a command will be stored.

When the execution attribute is "Interstage":

This is a job workunit name.

When the execution attribute is "PowerAIM" [UNIX]:

This is a job workunit name.

When the execution attribute is "Normal" [UNIX]:

This is a command name.

Completion code:

This is a job completion code. Completion code for unexecuted jobs is 0.

For a job net with the Job Execution Control attribute, completion code may exceed 256.

Status:

The job status can be specified using one of the following seven strings:

normal_end:

Indicates completed.

pseudo-normal:

Indicates pseudo-normal completion.

abnormal_end:

Indicates abended.

canceled:

Indicates canceled.

not_executed:

Indicates the job was not started.

paused:

Indicates the job has been paused.

disabled:

Indicates the job has been disabled.

The temporary file is created in the following directories:

[Windows]

In the work directory under the database directory of Jobscheduler

The name of the file is created in NEXnnn.tmp (nnn is appended by the system) format.

[Solaris, HP-UX]

/var/tmp directory

[AIX, Linux]

/tmp directory

Since the temporary file is not deleted on the Jobscheduler side, you must delete it from the exit program.

If the exit is not registered, the temporary file is not created.

About the Job in Passed Status

If the execution condition of the following job is specified in Condition concerning completion code of preceding job, the job that ends with the Passed status will be processed as follows:

A job that is waiting using the OR condition and is then canceled because of the OR condition of the following job will be processed as follows:

Exit Program Location

Windows

Systemwalker Operation Manager installation directory\MpWalker.JM\bin

Solaris
Linux

/opt/FJSVJOBSC/bin

HP-UX

/opt/FHPJOBSCH/bin

AIX

/usr/FAIXJOBSC/bin

Cautions

Program Example

Below is an example program for the job net abended extended exit:

[Windows]

/* When a job net abnormal completion occurs, sends the following messages to "MANAGEMENT"
   server.
              Job net name (group name) is abended !! code = completion code*/
#include <stdio.h>
#include <process.h>

main(int argc, char *argv[])
{
    char cmdline[256];

    sprintf_s(cmdline,sizeof(cmdline),
                "NET SEND MANAGEMENT %s(%s) is abended !! code = %s",
                argv[2],     //job net name
                argv[4],     //group name
                argv[5]);    //completion code

    system(cmdline);

    _unlink(argv[9]);    // temp file is deleted

    exit(0);
}

[UNIX]

/*
  Example program for the job net abended extended exit (for UNIX) which outputs a job
  net abnormal completion message with a group name, job net name, and completion code
  on the console.
*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <syslog.h>

main(int argc, char **argv)
{
    openlog ("jobsch", LOG_CONS, LOG_USER);
    syslog (LOG_WARNING,
        "WARNING: jobnet abnormal end. project=%s, group_name=%s, net_name=%s, net_comment=%s,
 net_code=%s, 
        argv[1], argv[4], argv[2], argv[3], argv[5]);
    closelog();

    unlink (argv[9]);
    exit(0);
}