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, these methods are available to start a job:

If the job status is In Queue, the Job Scheduler BSE Service or Job Daemon, starts the job.

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

This diagram illustrates the steps in the job handling procedure. It shows the session or action that you must carry out to complete the procedure:
[...]

The diagram shows that the Job Scheduler BSE Service, or the Job Daemon, can start the job if the job’s status is In Queue. If you use the Job Scheduler BSE Service, the job starts automatically and a running bshell is not required. The Job Scheduler BSE Service starts a bshell in the background, which starts the job with the Ativar tarefa (ttaad5203m000) session.

You must start the Job Scheduler BSE Service to ensure that the Job Scheduler BSE Service can start any job. If the Job Scheduler BSE Service runs, you can exit the bshell without any problem because the Job Scheduler BSE Service, and not your bshell, carries out the job.

If the job’s status is Free, you can use the Ativar tarefa (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 bshell.

To enable and start the Job Daemon on a Windows platform
Nota

We recommend that you use the Job Scheduler BSE Service instead of the Job Daemon. For more information see "BSE Services".

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
Nota

We recommend that you use the Job Scheduler BSE Service instead of the Job Daemon. For more information see "BSE Services".

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 Dados das tarefas (ttaad5500m000)

To run the job with Activate Job (ttaad5203m000)

Because your running bshell starts the job, you cannot close the bshell 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.