The {{StartService}} Tag

This tag starts the execution of a service program. Options, parameters and libraries to be used by the service are specified by ServiceOpts, ServiceArgs and ServiceLibs tags.

StartService (  program)

where:

program The name of the service program to run. If a relative path is specified, the path is relative to the directory that contains the .srf file. If no directory is specified, the RUNPATH is searched (see below).

BIS only allows one service program to be active in a session. Note the following:

When a service program is started, BIS saves the name of the program. When another service program is started, BIS compares the new program name against the name of the program currently running. If there is an exact match (ignoring differences in letter case), the service is the same. If there is any difference, the new StartService tag refers to a different service and the currently running service program is stopped.

Once the service program is started, page rendering resumes. Rendering and the service program run in parallel.

Examples:

1. {{ StartService ( myapp ) }}
2. {{ ServiceLibs  ( mylibrary.acu ) }}
   {{ StartService ( myapp ) }}
3. {{ ServiceLibs  ( xmlif mylibrary.acu ) }}
   {{ StartService ( myapp.cob ) }}
4. {{ ServiceOpts  ( -c alt.cfg ) }}
   {{ ServiceLibs  ( xmlif ) }}
   {{ StartService ( myapp ) }}

In the examples above, the .ACU, and library files must be in a directory specified by CODE_PREFIX, and .CFG files must be in the FILE_PREFIX.

  1. Starts the program in file myapp.acu.
  2. Attempts to start program myapp after loading the mylibrary.acu service library. If the library contains a program called myapp, it is run from the library. If the program is not in the library, then the first program in myapp.acu is started.
  3. Starts the program in myapp.acu after loading xmlif and mylibrary.acu.
  4. Starts program myapp.acu after loading xmlif. The alt.cfg file is processed when the service program is loaded.

The StartService tag follows all the regular Service Engine program loading rules. See the ACUCOBOL-GT documentation for a detailed description.