How an AESection is Accessed

When an AESection is opened (or accessed), the system first checks if it exists with the given input parameters.

If the base section you specify doesn’t exist, a new base section is created. This enables you to dynamically create sections as needed. In addition, if the target section doesn't exist, all section-level attributes are copied from the template to the target section. If the target exists, it retains its attribute settings.

If an effective date is specified (with EffDt), but there is no match using that effective date, the AESection is opened using the base effective date of ‘1900-01-01’.

The market defined for the current component is used for the section to be open. If no section with this market exists, the default GBL is used.

If you open an AESection object from within a running Application Engine program, the market value is set to the value of the current process.

The database platform you’re currently running is used as the database platform for the section to be opened. If no section with this database platform exists, the default "none" is used.

To find the correct section to open, the precedence is:

  1. Market

  2. Database platform

  3. Effective date

When a section is closed and its changes are saved, the market and database platform from the system that performed the changes is used as the market and database platform for the modified section.

Let’s take an example. Assume that you’re running on DB2 UDB for OS/390 and z/OS, and your current market is set to ‘MKT’. Assume that you want to open a section called Sect1 in an Application Engine program called TestAppl, and that your data looks something like this:

Number

Application Engine Program

Application Engine Section

Market

Platform

Effective Date

1

TestAppl

Sect1

USA

DB2

1990-01-01

2

TestAppl

Sect1

USA

None

1900-01-01

3

TestAppl

Sect1

GBL

None

1900-01-01

If you use:

&SECTION.Open("TestAppl", "Sect1", "1998-12-14");

Then the third section in the previous list is used, because the market takes highest precedence. When the section is saved, the values for market and platform are updated to the current system values.

Warning! When you open or get an AESection object, (that is, any base section) any existing steps in the section are deleted. You must add a new step to the section before you can modify it.

The other attributes of the section, however, are retained, with the exceptions noted previously.