Entry points >  Module Supervisor >  Standard script SERVJOB  

Display all Hide all

SETREQ

The SETREQ entry point is triggered during the creation of a request from a job file. It is used to manage process synchronization by retrieving the request number.

Context and operating mode

In the context of the entry point :

  • A trace file is open

The following tables are on line :

Table

Significant content

Table description

ABATRQT [ABR]

No

Batch server (queries)

ABATPAR [ABP]

No

Batch server (parameters)

The SETREQ entry point is inserted into the SERVJOB process right after the creation of the request in the ABATRQT table. This process is called by the batch server and all the global variables of the application are not defined.

The name of the log file of the batch server is contained in the FICTRA variable and it is possible to write into this log file using the STRACE sub-program of the SERVEUR process. The arguments passed in this sub-program are: FICTRA (Alpha), Error number (Integer), Request number (Integer), Comments (Alpha).

FICTRA contains the name of the open log
JOB contains the name of the job file
APPLI contains the name of the application on which the request is created

The ABATRQT and ABATPAR tables are opened and registered.

WRJOB: During the creation of the file sta

The WRJOB entry point is triggered during the creation of the file 'sta' or 'run'. It allows to manage the name of the file and modify the parameters before the writing of the file.

Context and operating method

In the context of the entry point :

  • A trace file is open

The following tables are on line :

Table

Significant content

Table description

ABATRQT [ABR]

No

Batch server (queries)

ABATPAR [ABP]

No

Batch server (parameters)

Call context

The WRJOB entry point is set in the SERVJOB processing, immediately before the creation of the file "sta".This process is called by the batch server and all the global variables of the application are not defined.

GPE is set to 0 if GSE is higher than 0 on return from the entry point. We exit the sub-program without writing the file.

Variables

List of variables processed by the sub-program call:

  • JOB: name of the .job file

  • TYP: file type, for example "sta"

  • ERR: Error number

  • REQ: Request number

  • APP: Folder

  • USR: User

  • TAC: Task

  • MES: Message

After the creation of the file if  DATDEB and  DATFIN are empty, these variables are set based on the following rules:

Case TYP

 When "sta"

  If [L]NUMREQ=0:  DATDEB = DD+HS

  Else

   If [F:ABR]DAT<>[0/0/0]: DATDEB = [F:ABR]DAT: Else: DATDEB = DD: Endif

   If [F:ABR]HDEB<>"": DATDEB += [F:ABR]HDEB

   Elsif [F:ABR]HEURE<>"": DATDEB += [F:ABR]HEURE+"00"

   Else: DATDEB += HS:

   Endif

  Endif

  DATFIN = DD+HS

 When Default

  DATDEB = DD+HS

  DATFIN = ""

Endcase

The remaining variables are not modified until their writing.

Example of usage

The FICHIER variable can be modified in order to change the "sta" file