Supported RPG Features

By default an externally-described data structure (DCL-DS ... EXT, DCL-DS ... EXTNAME('FILE'), or a fixed-format D ... E DS) imports each field under its short 10-character system name. Adding the ALIAS keyword imports each field under its alternative (long) name where one is defined:

DCL-DS emp EXTNAME('EMPMAST') ALIAS QUALIFIED;
// emp.EMPLOYEE_NAME, emp.EMPLOYEE_ID, ...  (long names)

The alternative name comes from either source of external description:

Only fields that actually have an alternative name are renamed; a field without one keeps its short system name even under ALIAS. Without the ALIAS keyword, every field keeps its short name and a reference to the long name is an undefined-field error.

ALIAS combines with PREFIX: the prefix is applied to the name in effect (the long name where ALIAS supplies one), and the PREFIX(...:n) character-replacement count removes characters only from short (non-aliased) names - an aliased long name simply has the prefix prepended. ALIAS is valid in both free-form DCL-DS and the fixed-format D-spec keyword area.