ALIAS

Describe an alias for a structure or field

ALIAS alias  type  name

alias

The name of a new or existing alias. This name can have a maximum of 30 characters.

type

The alias type. Valid values are STRUCTURE and FIELD.

name

The name of the aliased structure or field. This name can have a maximum of 30 characters.

The ALIAS statement describes an alternate name—an alias—for a structure or field.

Aliases enable you to associate a different name (or a name link) with a structure or field. For example, aliases are useful when you’re converting an application to use the Repository. If your application uses short, cryptic identifier names, but you would like to use longer names in the repository, you can use aliases to simplify updating your Synergy code. Aliases can also be useful when you want to define structfields, but still need that repository structure to be included as a record in your Synergy code. You can create an alias and reference that in your structfield definition.

When you use .INCLUDE to reference the repository from your Synergy code, you can use either the real or the alias name. The compiler first searches for a structure or field that has the name specified in the .INCLUDE statement. If it can’t find one, it searches for an alias with that name. Therefore, all structure names, whether real or alias, must be unique. Likewise, all field names — real or alias — must be unique within a given structure.

Within your Synergy Data Language file, an alias must be defined within the structure that it references (referred to as the aliased structure). You can link more than one alias to the same structure. Within an aliased structure, you can link more than one alias to the same field.

An aliased field is associated with the most recently defined aliased structure. If you haven’t defined an aliased structure yet, the aliased field is ignored. You cannot alias fields that are defined as members of a group.

Note

Aliases for fields are supported only through the Synergy Data Language. Aliases for structures can also be defined through the Repository user interface; see Defining aliases.

Adding new definitions

The order in which you define aliased fields determines the order in which they exist within the aliased structure. The maximum number of alias fields you can define within one aliased structure is 650.

Replacing existing definitions

All required keywords and data must be specified. The existing aliased structure is cleared and all of its aliased fields are deleted. The aliased structure is set to the specified attributes, and the specified aliased fields are added. (Note that when you replace a structure, any aliased structures that are not explicitly specified in the schema are unaffected.)

Overlaying existing definitions

All required keywords and data must be respecified. All of the aliased fields are deleted. The current aliased structure attributes are overwritten by the attributes specified, and the specified aliased fields are added.

Deleting aliases

To delete aliases that reference a structure or field that no longer exists, run the Verify Repository utility.

ALIAS cusmas STRUCTURE customer_master
   ALIAS cusnam FIELD customer_name
   ALIAS cusid FIELD customer_id
   ALIAS cusadd FIELD customer_address