Top
Systemwalker Operation Manager  Reference Guide
FUJITSU Software

17.1 Job Net Completed /Abended Exit

This section explains the exit program used when a job net registered on Jobscheduler ends in Completed, Pseudo-normal, Abended or Canceled.

[Windows]

If the job net ends in Completed or Pseudo-normal, the system searches for the normalexit.bat file first, and then the normalexit.exe file as the exit program. The exit program found will be used. If normalexit.bat is found, normalexit.exe will not be called up even if it exists.

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

If you want to use these exits 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 Completed or Pseudo-normal, the system searches for and calls the jobsch.exit.normal file as the exit program.

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

If you want to use these exits 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.

Parameters Passed to the Exit Program

The parameters passed to the exit program are as follows:

argc :

Number of parameters (7) (Note1)

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] :

Maximum length (character string) of job completion code in the job net

argv[5] :

Number of jobs in job net (character string)

argv[6] :

Temporary file name

argv[7] :

Subsystem number (character string) (Note2)

Note1:

In Systemwalker Operation Manager EE, the number of parameters is eight.

Note2:

This parameter is used in Systemwalker Operation Manager EE.

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 (numeric number between 0 and 256). Completion code for unexecuted job is 0.

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 completed exit file is created in NMLnnn.tmp (nnn is appended by the system) format and that of the abended exit file is created in NETnnn.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 the 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:

Cautions

Program Example

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

[Windows]

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

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

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

    system(cmdline);

    unlink(argv[6]);    // temp file is deleted

    exit(0);
}

[Solaris]

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

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

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

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