Database Naming Conventions

Lawson uses the database naming conventions described here. For more information on naming conventions for Lawson program components, see the Application Developer Workbench Standards guide.

Database Field Naming Conventions

In the Database Definition utility (dbdef), fields are named using the following conventions:

Syntax Used for Example
D@FieldName Key variables. D@STATE

D#START#FieldName

D#END#FieldName

Subrange key variables. D#START#VENDOR
DPFX FieldName File fields. In this example, the prefix (PFX) is CRL and the field name is FRDRCD. DCRLFRCRCD
DPFX@FieldName Variables as the record found flag. DPSA@NOTFOUND
DPFX@C@FieldName Comment attachment variables. DAGP@C@NAME
DPFS@U@FieldName URL attachment variables. DAGP@U@TYPE
DPFX@Abbr@FieldName

Database aggregate fields. For Abbr, use

AV Average
AG Aggregate
SU Sum
MI Mimimum
MA Maximum
DCRL@AV@CRRTBL

4GL Index Naming Conventions

In the Database Definition utility (dbdef), indexes are named using the following format:

<FilePrefix>SET<n>, where

  • <FilePrefix> is a three-letter abbreviation for the file.

  • <n> is an integer representing the Index number. The following conventions are often used, although they are not a requirement.

  • 1 is used for the primary (first) Index.

  • 2 through 16 are used for secondary indexes.

    For example, the primary index on the GLMASTER file is GLMSET1.

IBM i Index (Logical) Naming Conventions

The naming convention for indexes (logicals) in the RPG code is as follows:

DB<SystemCode><FilePrefix><IndexNbr>

where <SystemCode> is the system code the file you are inquiring on is associated with, <FilePrefix> is the prefix as defined in the Database Definition utility (dbdef) for the file, and <IndexNbr> is the number of the index you want to use to perform the call.

Most of the calls to the database input/output routines include the logical as part of the call. Whenever you see <Logical> in the documentation for a database input/output routine, it refers to the DB<SystemCode><FilePrefix><IndexNbr> naming convention.