Micro Focus Open PL/I

Statements:

%ACTIVATE

The replacement in a rescan operation is limited to 1023 characters.

References to preprocessor procedures will not be recognized when rescanning an identifier for replacement.

%ASSIGNMENT

%DEACTIVATE

%DECLARE

When declaring parameters in a preprocessor procedure, they should all be declared together in the first statement.

    • CHARACTER (abbreviation, CHAR) specifies that the identifier represents a varying length character string of up to 4096 characters.

    • FIXED specifies that the variable is also given the PL/I attributes DECIMAL (5,0).

    • BIT specifies that the identifier represents a bit string of maximum length 16.

    • An ENTRY declaration can be specified for each preprocessor entry name in the source program. The declaration activates the entry name. The declaration of a preprocessor procedure entry name can be performed explicitly by its appearance as the label of a %PROCEDURE statement. This explicit declaration, however, does not activate the preprocessor procedure name.

    • BUILTIN specifies that the identifier is the preprocessor built-in function of the same name.

%DO

Type-1 or Type-3 DO.

%[labe1:]... DO[index = start[TO finish[BY increment]] |

[BY increment [TO finish]]];

Preprocessor DO groups can be nested.

%END

Multiple closure, that is, using one %END to close multiple groups and/or blocks, is not permitted.

%GOTO

Alternate form: %GO TO for %GOTO.

The label following the GOTO cannot be the label of a preprocessor procedure.

%IF

%[label:]... IF expr %THEN clause-1 [%ELSE clause-2]

%INCLUDE

Included text can contain nonpreprocessor and/or preprocessor statements. The scan continues with the first character in the included text.

The included text is scanned in the same manner as the source program.

%INCLUDE statements can be nested to a limit of eight levels.

%NOTE

Purpose

Generates a preprocessor diagnostic message.

Syntax

%[label:]... NOTE (message [, code]);

Parameters

message is a character string expression whose value is the required diagnostic message. code is a fixed expression whose value (in a range of 0 to 16) indicates the severity of the diagnostic. If code is omitted, 0 is assumed.

A code of 16 (the maximum) causes immediate termination of the preprocessing.

%NULL

%REPLACE

%PROCEDURE

%label:[label:]... PROCEDURE[(ident[,ident]...)]

[STATEMENT]RETURNS(CHARACTER|FIXED|BIT);

The STATEMENT option is ignored in this version of Open PL/I.

One of the attributes, CHARACTER, FIXED, or BIT, must be specified in the RETURNS attribute list to indicate the type of value returned by the function procedure. There can be no default.

RETURN

[Return is valid only within a preprocessor procedure, hence no '%' is used.]

Builtins:

COMPILETIME

Returns a character string containing the current date and time in the following format:

DD MMM YY HH.MM.SS

COUNTER

Returns a character string containing a decimal number. The returned number is 00001 for the first invocation and is incremented by one on each successive invocation.

INDEX(x,y)

Returns a FIXED value indicating the starting position within the character expression x of a substring identical to character expression y.

LENGTH(x)

Returns a FIXED value specifying the current length of a given character expression x.

PARMSET(x)

Used to determine whether a specified parameter has been set on the invocation of a procedure.

SUBSTR(x,y[,z])

Returns a substring of the character expression x, starting at position y with length z.

TRANSLATE(s,t,x)

Replaces occurrences in the character string s of a character in the specified string x with the corresponding translation character in translation string t and returns the resulting string.

VARIANT

Returns a character string specified on the command line.