13.1 LANSA Object Names
It is strongly recommended that you review all object naming rules.
Object Name and Identifier relationship
Each LANSA object has two names – an Identifier -(or object or short name) and long Name, simply called Name.
An Identifier is automatically generated as each object is created. You don't have to accept the generated Identifier. If you want to use your own naming convention for Identifiers, simply specify your own identifier as you create the object. The LANSA Editor's Options has an option to display the Identifier on all dialogs. With this option selected, all Editor windows will display the Identifier (or object name).
- RDMLX partition either name may be used to refer to a LANSA object.
- RDML partition only the Identifiers (or short names) may be used. If your application is to be run on an IBM i, the identifier will be used.
Where a LANSA Guide uses the term "object name", either a long name or an identifier may be used and which one to use is generally specified.
General Name Rules
Following are some general rules and guidelines that apply to ALL objects stored in the LANSA Repository:
- LANSA Identifiers 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 the same as 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.
Name (long name) Rules
- A 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.
- Names must only contain the characters a-z, A-Z, and 0 – 9.
- The case of a letter as entered is retained for easier readability, but it must be unique and 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.
- All LANSA Names have the same rules, except Field Names and File Names which have implementation differences depending on the target databases required. These are described below:
- Field Name Rules for Oracle and DB2
- Oracle and DB2 for IBM i have a maximum column identifier length of 30 characters. If either of these databases is targeted and any Field Name in the LANSA file is longer than 30 characters ALL columns will use the LANSA field Identifier in ALL databases.
- File Name Rules for Oracle
- If the physical file or logical view has a 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 Name is longer than 30 characters, the table Identifier will use the LANSA file Identifier in ALL databases.
- Note that the table Identifier restriction is only on Oracle. All the other supported databases use 128 bytes.
Identifier (short name) Rules
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.
- 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.)
- 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.)
- 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.
The following rules apply to both physical and logical file identifiers:
- Table Identifiers must be valid for the target operating system and DBMS.
- Table 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 Table definition. Access route names must follow general naming rules.
- The process Identifier must be unique within the entire LANSA System.
- A maximum of 8 characters 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.
- 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 Identifiers 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.
Identifier 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 multi-platform 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. This means that when using communications between operating systems on different platforms, the object Identifiers will match correctly.