Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Programming Guide


PGMNAME

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

Read syntax diagramSkip visual syntax diagram
PGMNAME option syntax

            .-COMPAT----.     
>>-PGMNAME(-+-LONGMIXED-+-)------------------------------------><
            '-LONGUPPER-'     

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:

PGMNAME(COMPAT)

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.

PGMNAME(LONGUPPER)

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.

PGMNAME(LONGMIXED)

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'.

Usage notes

  • The following elements are not affected by the PGMNAME option:
    • Class-names and method-names.
    • System-names (assignment-names in SELECT . . . ASSIGN, and text-names or library-names in COPY statements).
    • Dynamic calls. Dynamic calls are resolved with the target program-name truncated to eight characters, folded to uppercase, and translation of embedded hyphens or a leading digit.
    • CANCEL of nonnested programs. Name resolution uses the same mechanism as for a dynamic call.
  • The PGMNAME option does affect nested-program calls and static calls to programs that are linked together with the caller.
  • Link-edit considerations: COBOL programs that are compiled with the PGMNAME(LONGUPPER) or PGMNAME(LONGMIXED) option must be link-edited in AMODE 31.
  • Dynamic calls are not permitted to COBOL programs compiled with the PGMNAME(LONGMIXED) or PGMNAME(LONGUPPER) options unless the program-name is less than or equal to 8 bytes and all uppercase. In addition, the name of the program must be identical to the name of the module that contains it.
  • When using the extended character set supported by PGMNAME(LONGMIXED), be sure to use names that conform to the linkage-editor, binder, prelinker, or system conventions that apply, depending on the mechanism used to resolve the names.

    Using characters such as commas or parentheses is not recommended, because these characters are used in the syntax of linkage-editor and binder control statements.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)