Introduction to Session Parameters

The following topics are covered:


Session Parameter Usage

In Natural, session parameters are used:

  • to specify certain characters,

  • to set processing time limits,

  • to set a particular response for a given condition,

  • to set various size limits,

  • to determine various aspects of output reports.

At the installation of Natural, the Natural administrator sets these parameters to default values which are then valid for all users of Natural.

To see which parameter values apply to your session, you enter the system command GLOBALS (described in the System Commands documentation).

How to Set Session Parameters

Natural session parameters can be set in several ways:

  • via the default Natural parameter file NATPARM, which is set when Natural is installed;

  • via dynamic parameters specified when invoking Natural (as described in your Natural Operations documentation);

  • via the system command GLOBALS;

  • via the Session Parameters command in the Tools menu of Natural Studio;

  • via a SET GLOBALS statement (in reporting mode only);

  • via a FORMAT statement;

  • via parameter specification within statements where parameters also are evaluated, for example, INPUT, DISPLAY, WRITE;

  • via terminal commands.

Instead of the parameter values ON and OFF, you can also specify T (true) or F (false) respectively.

Changing Session Parameters at Session Level Using the GLOBALS Command

For your Natural session you can change some of the parameter values set by the Natural administrator.

Within your Natural session, you can change these parameters by issuing the following system command:

GLOBALS

When you issue the GLOBALS command, a screen is displayed showing the parameter values that are currently in effect for your session. On this screen, you can change the values that do not suit your requirements.

A parameter value set with a GLOBALS command remains in effect until the end of the Natural session (and applies to every object you store during the session), unless you change it again with another GLOBALS command.

Changing Session Parameters at Program Level Using the FORMAT Statement

You can change certain parameters for the duration of a single program (report). This is done by using a FORMAT statement in the program, which will override the session-wide settings for these parameters.

Example of a FORMAT Statement:

FORMAT AL=10 HC=R

Parameters set with a FORMAT statement apply until the end of the executed program, unless they are changed with another FORMAT statement in the program.

Not all session parameters can be changed at program level, while several parameters that can be specified at program level cannot be specified at session level; most of the latter are parameters which affect the format of an output report.

Changing Session Parameters at Statement Level

Most of the parameters you can change with a FORMAT statement you can also change for an individual statement; for example, for a particular DISPLAY, WRITE, INPUT or REINPUT statement.

This is done by specifying the parameter (in parentheses) after the statement name.

Example:

DISPLAY (SF=4) NAME JOB-TITLE CURR-CODE SALARY

A parameter set at statement level applies only to the statement in which it is specified. The setting at statement level overrides, for that statement only, all other settings of that parameter at other levels.

Changing Session Parameters at Field Level

Within a DISPLAY, WRITE, INPUT or REINPUT statement, you can also change some parameters for an individual field or output element.

This is done by specifying the parameter (in parentheses) after the field name.

Example:

DISPLAY NAME (AL=10) JOB-TITLE CURR-CODE SALARY

The parameter value then applies only to that field. The setting at field level overrides, for that field only, all other settings of that parameter at other levels. However, only some of the parameters that can be set at statement level can also be set at field level.

Session Parameter Evaluation

Parameters specified with the statements DISPLAY, FORMAT, PRINT, INPUT, REINPUT, WRITE, WRITE TITLE and WRITE TRAILER are processed during program compilation and are therefore included in the corresponding object module for the program.

The following hierarchy is used for evaluation:

  1. Parameters set at element/field (highest priority)

  2. Parameters set at statement level

  3. Parameters set with a FORMAT statement

  4. The default parameter settings (lowest priority)

Parameters set with a SET GLOBALS statement cause the execution time environment to be modified. These modifications remain in effect until overridden by another SET GLOBALS statement (or GLOBALS system command).