12 1 LANSA Object Names

LANSA Technical

12.1 LANSA Object Names

It is strongly recommended that you review all object naming rules.

Object Long Name, Short Name and Identifier Relationship

Each LANSA object has two names – a long name and an identifier. Generally, either name may be used to refer to a LANSA object.

An RDML partition only permits identifiers to be used. An RDMLX partition may be enabled for long names.

Short Name is another term for an identifier. The LANSA Editor has a setting to show short names. With this set, all Editor browser windows will display the identifier for the object name.

Where a LANSA Guide uses the term "object name", either a long name or an identifier may be used, unless otherwise specified.

General Name Rules

Following are some general rules and guidelines that apply to ALL objects stored in the LANSA Repository:

  • LANSA object names must be unique in a LANSA partition. For example, if a field is created with the name EMPNO, then no other object (file, component, function, etc.) can use this name.
  • Long  names must not be an existing identifier and vice versa. This allows either to be used anywhere an object name is required as these are unique names in the partition.
  • Names are NOT case sensitive. The EMPNO and Empno and EmpNo are considered the same name.
  • Embedded blank characters are not allowed in names. For example, "EMP NO" is not a valid name, however, "EMP_NO" is a valid name for some objects.
  • It is recommended that you do not use these reserved prefixes and reserved names: _, X, X_,  COM, COM_,  SYS,  SYS_, SYSTEM, SYSTEM_, LAN, LAN_, LANSA, LANSA_ and PRIM_ in your object names.

Object Long Name Rules

  • Long names must only contain the characters a-z, A-Z, and 0 – 9.
  • The case of the letter as entered is retained for easier readability, but it must be unique insensitive to case. E.g. a long name of Aa is stored and displayed everywhere as Aa, but another object cannot be called AA or aa.
  • A long name may be up to 256 characters long.
  • The first 128 characters must be unique in a LANSA partition and must not be the same as an identifier.
  • All LANSA object types have the same rules, apart from Field Long Names and File Long Names which have implementation differences depending on the target databases required as described below.

Field Long Name Rules

  • Oracle and DB2 for i have a maximum column identifier length of 30 characters. If either of these databases is targeted and any Field long name in the LANSA file is longer than 30 characters ALL columns will use the LANSA field identifier (short name) in ALL databases.

File Long Name Rules

  • If the physical file or logical view has a Long Name that is less than 9 characters, the identifier will be used instead.
  • Oracle has a maximum table identifier length of 30 characters. If Oracle is targeted and the File long name is longer than 30 characters the table identifier will use the LANSA file identifier (short name) in ALL databases.
  • Note that the table identifier restriction is only on Oracle. All the other supported databases use 128 bytes.

Object Identifier (Short Name) Rules

  • LANSA converts all identifiers to uppercase characters in the repository.
  • First character of names should be A to Z. (Characters $, @ and # are allowed in some names but are not recommended.)
  • For simplicity, it is strongly recommended that you use only characters A to Z and 1 to 9 in LANSA object names. Using special characters (#, _, @, $, etc.) are allowed in some object names but may have portability and other impacts.

Field Identifiers

  • First character must be A to Z. Do not use @ anywhere in field identifiers. Characters $, _,  and # are allowed but are not recommended.
  • Field identifiers are restricted to a maximum of 9 characters.
  • Avoid the use of field identifiers like SQLxxx, as this may cause problems when used in functions that use SQL (Structured Query Language) facilities. (IE Command SELECT_SQL.)

Component identifiers

  • First character must be A to Z. Do not use @ anywhere in component identifiers. Characters $, _, and # are allowed but are not recommended.
  • Component identifiers are restricted to a maximum of 9 characters.

File Identifiers

The following rules apply to both physical and logical file identifiers:

  • File identifiers must be valid for the target operating system and DBMS.
  • File identifiers are restricted to a maximum of 10 characters.
  • The first character must be A to Z or $, #, @. Remaining characters may be A to Z, 0 to 9, or $, #, @. The use of "_" (underscore) is not allowed.
  • Access route are considered part of a file definition and are not considered a separate LANSA object. Their names must be unique within the file definition. Access route names must follow general naming rules.

Process Identifiers

  • The process identifier must be unique within the entire LANSA System.
  • A maximum of 8 character process identifiers is recommended. Maximum length for a process identifier is 10 characters.
  • IBM i: A process identifier must be unique within a LANSA partition. A function identifier must be unique within the process it is created.
  • Windows: A process identifier must be unique within the entire LANSA system. All functions must be defined as type *DIRECT. Functions identifier must be unique in the partition.
  • Windows: If 10 character process identifier are used on Windows, the last 9 characters must be unique as first character is truncated when generating some program names.

Function Identifiers

  • RDML function identifier must not use "_" (underscore).
  • Function identifier Fnnnnnn/Cnnnnnn/Pnnnnnn (where nnnnnn is in range 1 to 999999) are reserved words.
  • Function identifier MENU, EXIT, HELP, SELECT, EOJ, ERROR, RETRN, and *ANY are reserved.
  • Function identifier are restricted to a maximum of 7 characters.
  • IBM i: A function identifier must be unique within the process it is created.
  • Windows: All functions must be defined as type *DIRECT. Function identifiers must be unique in the partition.

Platform Considerations

  • Characters such as #, $ or @ may have language code translation issues if your application is executing in more than one country. Using special characters with caution or simply avoid using special characters in object identifiers.
  • For multiplatform applications, LANSA object identifiers should only contain the characters A to Z or 0 to 9  because these characters do not change between the different code pages. Thus when using communications between operating systems on different platforms, the object identifiers will match correctly.