HP 3000 Manuals

BACKGRND Command [ HP ALLBASE/4GL Developer Reference Manual Vol. 2 ] MPE/iX 5.0 Documentation


HP ALLBASE/4GL Developer Reference Manual Vol. 2

BACKGRND Command 

The BACKGRND command executes a process as a background task.

Formats 

BACKGRND {process_name}
         {data_ref    }

Parameters 

process_name 

The name of an HP ALLBASE/4GL process.

data_ref 

May be one of the following whose content is a valid HP ALLBASE/4GL
process name:

   *   Constant.

   *   Variable or calculated item.

   *   Screen field name.

   *   Scratch-pad field name.

Description 

The BACKGRND command executes a process as a background task, releasing
the terminal for data entry or inquiries while HP ALLBASE/4GL executes
the process.

You must specify a valid process name or a data_ref whose content is a
valid process name.

Once HP ALLBASE/4GL has started executing the background process, the
background process cannot accept further data input from the user.

HP ALLBASE/4GL executes a background process by creating and then
streaming a job file.  The job file is then purged immediately.  HP
ALLBASE/4GL can execute more than one background process at any given
time and more than one background process can share the same name since
each background process becomes a separate MPE/iX job.

During normal application execution, HP ALLBASE/4GL writes any messages
issued by the background process to $STDLIST. When trace mode is in use
under application testing mode, messages from background processes are
logged to a file Mnnnnxxx in the current group and account.  In this file
name, nnnn is a four digit number indicating the MPE/iX session number
for the parent process (that is, the HP ALLBASE/4GL session that
initiated the background process).  The term xxx is a three digit number
to distinguish background processes belonging to the same parent process.

The process terminates if any message issued by the background process is
an abort type message.  All other messages, including query messages, are
treated as message type messages.  The background process does not wait
for a response to query messages.

Unless the background process aborts due to an error condition, it runs
to completion even if the user terminates the HP ALLBASE/4GL session and
logs out of MPE/iX.

HP4BG Variable 

To run a background process, HP ALLBASE/4GL must create and then stream a
suitable job file.  To allow HP ALLBASE/4GL to create this file, the user
must set the MPE/iX variable HP4BG containing the correct user, group and
account passwords.  The variable must contain a valid logon sequence, but
must not contain the job keyword.  For example, the HP4BG variable could
be set as follows:

     setvar HP4BG "jobname, username/password.account/password"

If you don't specify a job name in this variable, the name of the job
defaults to the user's HP ALLBASE/4GL sign-on name.

Background Process Information File 

HP ALLBASE/4GL creates a disk file to pass information from the current
foreground process to the background process.  This file is called
HP4nnnnn, where nnnnn is a five digit number.  The information file is
purged when the background process stream job starts.

Background Process Environment 

The background process stream job sets a number of variables and JCWs to
allow the background HP ALLBASE/4GL process to run.  The variables and
JCWs set by the background process stream job are:

   *   HP4BG

   *   HP4SPATH

   *   HP4DBMPATH

   *   HP4DATAPATH

   *   NLUSERLANG

   *   NLDATALANG

If the background process, or any external programs called by the
background process require further variables or JCWs, these must be set
in a logon UDC.

Limitations 

The background process takes a snapshot copy of the HP ALLBASE/4GL
environment and stores it in the HP4nnnnn file when it starts.  The
background process cannot use the copied contents of file record buffers
or screen field buffers as these are cleared when the process starts.
You cannot pass any further values to a background process, and the
background process can only return values to the foreground process by
writing them to a disk file.

Example 

     BACKGRND end_month_roll

This command executes the process end_month_roll as a background task.



MPE/iX 5.0 Documentation