Entry points > Module Supervisor > Standard script SERVSYS 

LANRUN: Modify the launching language of a batch request

This entry point is used to modify the language each time a query is run by the batch server.

For now, the batch task is run with the language code of the batch server. For a multi-language solution (single or multiple folder), this can be a problem when processing the import error messages (in effect, the messages generated by the mess() function are depend on the language code of the adonix command launched).

The SERVSYS processing looks for the language used by the batch server and stored in GLANGUE among the list of languages defined for the folder. 

Example: let us consider a solution with N folders operating with a local language and an administration language (i.e.: SPA-FRA, ENG-FRA).If the batch server is launched with the FRA language, all messages in all folders will be in French.
The goal is to
have messages in English in an ENG folder, messages in Spanish in a SPA folder.The administration messages will remain in French in the English folder and the Spanish folder.

Warning:

The batch server run on the SERVX3 folder uses the SERVSYS processing located in the TRT directory of the X3 standard reference folder.

The entry point declaration and the specific process associated with it must be located in the X3 reference folder so that this entry point might be taken into account.
Moreover, as all the global variable are not declared, it is recommended to test their presence before using them. For example, the GLON* global variables are not declared.

Context and operating mode

The LANRUN entry point is called each time a query is run.It is located in the REQUETE subprogram of the SERVSYS processing.

Subprog REQUETE(PID)
Variable Char PID
Local Char LANGUE(5)
If clalev([F:ADS])=0 : Local File ADOSSIER [ADS] : Endif
Read [ADS]DOSSIER = [F:ABR]DOSSIER
GPE = 0
GPOINT = "LANRUN" : Gosub ENTREE From EXEFNC
If !GPE
 If dim([F:ABR]LAN)>0 & [F:ABR]LAN<>""
  LANGUE = [F:ABR]LAN
 Else
  Language = [F:ads]LANDEF
 Endif
 If find(LANGUE,[F:ADS]LAN(0..[F:ADS]NBRLAN-1))=0
  LANGUE = [F:ADS]LAN(0)
 Endif
Endif

For information purposes, with Unix, the batch task will be run (depending on the options) using the following system command:

EXEC_ENTREP="BATCH" RQT_ENTREP=NoRequête adonix -a -l LANGUE </tmp/serveur.ent >>/tmp/NoRequête.log 2>&1