Setting compiler options

Compiler options affect how the editor interprets your COBOL or PL/I programs for editing. You can specify compiler options in property groups in ZAPP files as well as inline in individual program files. The following sections provide references and examples for each language currently supported by the editor.

COBOL

Table 1. COBOL Compiler Options

Aspect of your programCompiler optionsDefaultOption abbreviations
Source languageCURRENCYNOCURRENCYCURR|NOCURR

CURRENCY

You can use the CURRENCY compiler option to provide an alternative default currency symbol to be used for COBOL program.

Syntax

'CURRENCY= NO |literal

Default: CURRENCY= $

CURRENCY=NO is the default option. CURRENCY abbreviations are CURR or NOCURR.

literal Represents the default currency symbol that you want to use in your program. The literal must be an alphanumeric literal (optionally a hexadecimal literal) representing a 1-byte EBCDIC character that must not be any of the following items:

  • Digits zero (0) through nine (9)
  • Uppercase alphabetic characters: A B C D P R S V X Z
  • Lowercase alphabetic characters a through z
  • The space
  • Special characters: \* + - / , . ; ( ) = "
  • Uppercase alphabetic character G, if the COBOL program defines a DBCS item with the PICTURE symbol G. The PICTURE clause will not be valid for that DBCS item because the symbol G is considered to be a currency symbol in the PICTURE clause.
  • Uppercase alphabetic character N, if the COBOL program defines a DBCS item with the PICTURE symbol N. The PICTURE clause will not be valid for that DBCS item because the symbol N is considered to be a currency symbol in the PICTURE clause.
  • Uppercase alphabetic character E, if the COBOL program defines an external floating-point item. The PICTURE clause will not be valid for the external floating-point item because the symbol E is considered to be a currency symbol in the PICTURE clause. For more details, see CURRENCY compiler optionopen in new window

Examples

You can define the CURRENCY option in the source program as a suboption or in a property group compiler option.

To define in the source program, use the following lines:

cbl CURRENCY();`

To define in property groups, add the following lines:

propertyGroups:
  - name: cobol-settings
    language: cobol
    compilerOptions: "currency(€)"

After you properly defined the currency option in property groups or in the source program as a suboption, you can use in your source program. For example:

      01 WS-TEST-FIELD            PIC €€€,€€9.99.

For more details, see CURRENCY compiler optionsopen in new window

PL/I

Table 1. PL/I Compiler Options

Compile-time optionAbbreviatedz/OS® default
MARGINS(m,n[,c]) | NOMARGINSMAR(m,n)MARGINS F-format: (2,72) V-format: (10,100)
NOT-NOT('¬')
OR('c')-OR(' | ')

MARGINS

The MARGINS option specifies which part of each compiler input record contains PL/I statements, and the position of the ANS control character that formats the listing, if the SOURCE option, the INSOURCE option, or both apply. The compiler does not process data that is outside these limits, but it does include it in the source listings. The PL/I source is extracted from the source input records so that the first data byte of a record immediately follows the last data byte of the previous record. For variable records, you must ensure that when you need a blank, you explicitly insert it between margins of the records.

Syntax:

MARGINS(--+-m-+--,--+-n--+--+------+--)-.| '-,--c-' |
> > -+-NOMARGINS----------------------+---------------><

m

The column number of the leftmost character (first data byte) that is processed by the compiler. It must not exceed 100.

n

The column number of the rightmost character (last data byte) that is processed by the compiler. It should be greater than m, but must not exceed 200. Variable-length records are effectively padded with blanks to give them the maximum record length.

c

The column number of the ANS printer control character. It must not exceed 200, and it should be outside the values specified for m and n. A value of 0 for c indicates that no ANS control character is present. Only the following control characters can be used:

(blank): skip one line before printing

0: skip two lines before printing

–: skip three lines before printing

+: no skip before printing

1: start new page

Any other character is an error and is replaced by a blank.

Do not use a value of c that is greater than the maximum length of a source record, because this causes the format of the listing to be unpredictable. To avoid this problem, put the carriage control characters to the left of the source margins for variable-length records.

Specifying MARGINS(,,c) is an alternative to using %PAGE and %SKIP statements according to the PL/I Language Reference.

The IBM®-supplied default for fixed-length records is MARGINS(2,72). For variable-length and undefined-length records, the IBM-supplied default is MARGINS(10,100). This specifies that there is no printer control character.

Use the MARGINS option to override the default for the primary input in a program. The secondary input must have the same margins as the primary input.

The NOMARGINS option will suppress any previously encountered instance of the MARGINS option. The purpose of this option is to allow your installation to have a default set of compile-time options that use a MARGINS option tailored for their fixed format source preferences while retaining the ability to use variable source format files. You would usually specify the NOMARGINS option, if you use it at all, as part of the parameter-string passed to the compiler. The compiler will ignore NOMARGINS if it finds the option in a %PROCESS statement.

Examples

Define the MARGINS compiler option either in the source program or in property groups.

To define in the source program, use the following lines:

%process MARGINS(<column number of the leftmost character, column number of the rightmost character>);

To define in property groups, add the following lines:

propertyGroups:
  - name: pl1-settings
    language: pl1
    compilerOptions: "MARGINS(2,100)"

NOT

You can use the NOT option to specify up to seven alternative symbols that can be used as the logical NOT operator.

Syntax

NOT('---char-+-')

char:

A single SBCS character

You cannot specify any of the alphabetic characters, digits, or special characters defined in the PL/I Language Reference, except for the standard logical NOT symbol (¬). You must specify at least one valid character. When you specify the NOT option, the standard NOT symbol is no longer recognized unless you specify it as one of the characters in the character string. For example, NOT('~') means that the tilde character, 'A1'X, will be recognized as the logical NOT operator, and the standard NOT symbol, '¬', '5F'X, will not be recognized. Similarly, NOT('~¬') means that either the tilde or the standard NOT symbol will be recognized as the logical NOT operator. The IBM-supplied default code point for the NOT symbol is '5F'X. The logical NOT sign might appear as a logical NOT symbol (¬) or a caret symbol (^) on your keyboard.

Default

NOT(¬)

Examples

Define NOT compiler option either in the source program or in property groups.

To define in the source program, use the following lines:

%process NOT(symbol);

To define in property groups, add the following lines:

propertyGroups:
  - name: pl1-settings
    language: pl1
    compilerOptions: "NOT(!)"

After proper definition, you are ready to use your custom NOT symbol in your program. For example:

    if (! abc > 0 )

OR

The OR option specifies up to seven alternative symbols as the logical OR operator. These symbols are also used as the concatenation operator, which is defined as two consecutive logical OR symbols.

Syntax

OR('---char-+-')

char:

A single SBCS character

You cannot specify any of the alphabetic characters, digits, and special characters defined in the PL/I Language Reference, except for the standard logical OR symbol (|). You must specify at least one valid character. If you specify the OR option, the standard OR symbol is no longer recognized unless you specify it as one of the characters in the character string. For example, OR('\') means that the backslash character, 'E0'X, will be recognized as the logical OR operator, and two consecutive backslashes will be recognized as the concatenation operator. The standard OR symbol, '|', '4F'X, will not be recognized as either operator. Similarly, OR('\|') means that either the backslash or the standard OR symbol will be recognized as the logical OR operator, and either symbol or both symbols can be used to form the concatenation operator.

PL/I parser will parse your source code up to the last column number you specify in your margins setting.

Default

(|)

Examples

Define OR compiler option either in the source program or in property groups.

To define in the source program, use the following lines:

%process OR(symbol);

To define in property groups, add the following lines:

propertyGroups:
  - name: pl1-settings
    language: pl1
    compilerOptions: "OR(|)"

After proper definition, you are ready to use your custom OR symbol in your program. For example:

    if (xyz | yz)

References

Last Updated:
Contributors: Peter Haumer, Lauren Li, kmaselli, Hestia Zhang, Min Huang, Peter Haumer