Job handling procedure

Procedure aim

With the job handling procedures, you can start, block, cancel, queue, and release jobs.

Procedure result and prerequisites
Result

This procedure results in a job that runs according to the job calendar or interval that is defined in the job’s basic data, without user interaction. This helps you to use LN’s resources more efficiently.

Prerequisites

You can only use the job handling procedure when the job data procedure is completed.

Steps in the job management procedures

Depending on the job’s status, the following methods are available to start a job:

If the job status is In Queue, the Job Daemon starts the job.

If the job’s status is Free, you can start the job in the following ways:

  • Run the 激活作业 (ttaad5203m000) session
  • Use the rc.startjob shell command (UNIX platform)
  • Use the startjob.bat batch file (Windows platform)
The following figure illustrates the steps in the job handling procedure translated into the session or action that you must carry out to complete the procedure:
[...]

This figure shows that the Job Daemon can start the job if the job’s status is In Queue. If you use the Job Daemon, the job starts automatically and a running VM is not necessary. The Job Daemon starts a VM in the background, which starts the UNIX shell program rc.startjob. The UNIX shell program then starts the job with the Activate Job Daemon session and the 激活作业 (ttaad5203m000) session.

You must start the Job Daemon to make sure that the Job Daemon can start any job. If the Job Daemon runs, you can exit the VM without any problem because the Job Daemon, and not your VM, carries out the job.

If the job’s status is Free, you can use the 激活作业 (ttaad5203m000) session, the UNIX shell program rc.startjob, or the Windows batch file startjob.bat to start the job manually. In this case, you must have a running VM.

To enable and start the Job Daemon on a Windows platform

The Application Services Manager (ASM) manages (externally) the Job Daemon service.

Typically, a Job Daemon runs jobs for one company. To run jobs for more companies, you must create a Job Daemon entry, in ASM, for each company. Per entry, use the BSE_COMPNR and PACKAGE_COMB variables to specify the company for which a Job Daemon must be started, and the package combination to which that company is linked.

To start the Job Daemon on a UNIX platform

To start the Job Daemon, you can include the ${BSE}/etc/rc.startjobdm command in the ${BSE}/etc/rc.start file. As a result, the Job Daemon starts when you start the LN environment.

Typically, a Job Daemon runs jobs for one company. To run jobs for multiple companies, you must change the rc.start file to start Job Daemons for each company. Per Job Daemon entry, use the BSE_COMPNR and PACKAGE_COMB variables to specify the company for which a Job Daemon must be started, and the package combination to which that company is linked.

Stop the Job Daemon

To stop the Job Daemon you can include the ${BSE}/etc/rc.stopjobdm command in the ${BSE}/etc/rc.stop script. As a result, the Job Daemon stops when you stop the LN environment. To stop jobs for multiple companies, you must include multiple entries of rc.stopjobdm in the rc.stop file. Use the BSE_COMPNR and PACKAGE_COMB variables to specify the company for which a Job Daemon must be stopped, and the package combination to which that company is linked.

To run a job with the Job Daemon

To use the Job Daemon to start a job, you must ensure that the job’s status is In Queue.

Session 作业数据 (ttaad5500m000)

To run the job with Activate Job (ttaad5203m000)

Because your running Virtual Machine (VM) starts the job, you cannot close the Virtual Machine (VM) until the job is finished. If the job is started prior to the time and date of execution, the job’s status changes to Waiting. After the job is carried out, the job’s status changes to Running.

If you must start a job that belongs to more then one company, you must switch to the required company with the Change Company command, before you start the job.

To run the job with the rc.startjob shell program

You can also start the job with the UNIX shell program ${BSE}/etc/rc.startjob.

To start the job, at the UNIX prompt you must enter:

${BSE}/etc/rc.startjob [job name]

Scheduling

If the rc.startjob program is included in a UNIX crontab, the program can automatically start jobs. For this purpose, some UNIX variables must be defined in the shell script. Additional information about how to define the UNIX variables is included in the shell script of the rc.startjob.

Run jobs for multiple companies

If you must start jobs that pertain to different company numbers, different versions of the rc.startjob script are created.

To run the job with the startjob.bat batch file

On a Windows platform you can start jobs with the startjob.bat batch file.

To start a job, take the following steps:

  • Start a Command Prompt (cmd) on your LN server
  • Go to the ${BSE}\bin directory
  • Run the fillenv.bat batch file to set the LN environment variables
  • Type startjob.bat [job name] to start the job

Scheduling

To automate the execution of jobs, you can include startjob.bat in an external job scheduler, for example, the Windows scheduler. For this purpose, you must set the LN environment variables in the startjob.bat batch file. To achieve this, you can copy the settings in the fillenv.bat batch file to the startjob.bat file.

Run jobs for multiple companies

If you must start jobs that pertain to different company numbers, different versions of startjob.bat are created.