The PGMNAME option controls the handling of program-names and entry-point names.
PGMNAME option syntax

Default is: PGMNAME(COMPAT)
Abbreviations are: PGMN(LM|LU|CO)
LONGUPPER can be abbreviated as UPPER, LU, or U. LONGMIXED can be abbreviated as MIXED, LM, or M.
PGMNAME controls the handling of names used in the following contexts:
- Program-names defined in the PROGRAM-ID paragraph
- Program entry-point names in the ENTRY statement
- Program-name references in:
- Calls to nested programs
- Static calls to separately compiled programs
- Static SET procedure-pointer TO ENTRY literal statement
- Static SET function-pointer TO ENTRY literal statement
- CANCEL of a nested program
With PGMNAME(COMPAT), program-names are handled in a manner compatible with older versions of COBOL compilers:
- The program-name can be up to 30 characters in length.
- All the characters used in the name must be alphabetic, digits, or the hyphen, except that if the program-name is entered in the
literal format and is in the outermost program, then the literal can also contain the extension characters @, #, and $.
- At least one character must be alphabetic.
- The hyphen cannot be used as the first or last character.
External program-names are processed by the compiler as follows:
- They are folded to uppercase.
- They are truncated to eight characters.
- Hyphens are translated to zero (0).
- If the first character is not alphabetic, it is converted as follows:
- 1-9 are translated to A-I.
- Anything else is translated to J.
With PGMNAME(LONGUPPER), program-names that are specified in the PROGRAM-ID paragraph as COBOL user-defined words must
follow the normal COBOL rules for forming a user-defined word:
- The program-name can be up to 30 characters in length.
- All the characters used in the name must be alphabetic, digits, or the hyphen.
- At least one character must be alphabetic.
- The hyphen cannot be used as the first or last character.
When a program-name is specified as a literal, in either a definition or a reference, then:
- The program-name can be up to 160 characters in length.
- All the characters used in the name must be alphabetic, digits, or the hyphen.
- At least one character must be alphabetic.
- The hyphen cannot be used as the first or last character.
External program-names are processed by the compiler as follows:
- They are folded to uppercase.
- Hyphens are translated to zero (0).
- If the first character is not alphabetic, it is converted as follows:
- 1-9 are translated to A-I.
- Anything else is translated to J.
Names of nested programs are folded to uppercase by the compiler but otherwise are processed as is, without truncation or
translation.
With PGMNAME(LONGMIXED), program-names are processed as is, without truncation, translation, or folding to uppercase.
With PGMNAME(LONGMIXED), all program-name definitions must be specified using the literal format of the program-name in the
PROGRAM-ID paragraph or ENTRY statement.
The literal used for a program-name (in any of the contexts listed above as affected by the PGMNAME option) can
contain any character in the range X'41'-X'FE'.
© Copyright IBM Corp.