IBM PL/I for OS/2

This information is based on Personal PL/I version 1.1

"%Statements should be on a line by themselves."

This compiler is unique (I believe) in making a distinction between preprocessor statements allowed in open code and those allowed in preprocessor procedures. The information that follows is the first case. In the second case the macro language closely models the full PL/I language.

statements.

    • %ACTIVATE

The %ACTIVATE statement makes a macro variable or an implicit macro invocation eligible for replacement in

the subsequent source text.

An explicit macro invocation is not affected by nor does it affect the %DECLARE, %ACTIVATE, or

%DEACTIVATE statements.

Abbreviation: %ACT

identifier

Name of the macro variable or procedure. The identifier cannot refer to an array variable or a

built-in function.

RESCAN

Specifies that the identifier is replaced as many times as necessary to replace all active identifiers

before being placed into the output.

SCAN Specifies that the identifier is replaced only once before being placed into the output.

NORESCAN

Synonym for SCAN.

Using the %ACTIVATE statement for an identifier that is already active has no effect, except possibly to change the scanning status.

    • %assignment

The %assignment statement evaluates a macro facility expression and assigns the result to the variable,

after performing any necessary conversions. The variable need not be active nor have any specific scanning

status.

reference

Specifies the name of a macro facility variable or a specific element if it is an array variable.

Compound assignments are not allowed.

    • %DEACTIVATE

The %DEACTIVATE statement makes a macro variable or an implicit macro invocation ineligible for

replacement in subsequent source text. The value of a macro variable is unaffected by the %DEACTIVATE

and the %ACTIVATE statements.

An inactive variable or inactive implicit macro invocation is not replaced in subsequent source text.

Abbreviation: %DEACT

identifier

Name of the macro variable or macro procedure that is made ineligible for replacement. The identifier

cannot refer to an array variable or a built-in function.

    • %DECLARE

The %DECLARE statement establishes an identifier as a macro variable, a macro procedure, or a built-in

function. In addition, scanning status can be specified for macro variables.

Abbreviations: %DCL for %DECLARE, CHAR for CHARACTER, INT for INTERNAL, EXT for EXTERNAL

identifier description

Specifies the names and attributes of macro facility identifiers.

BUILTIN

Specifies that the identifier is a macro facility built-in function. For more information, see Macro

facility built-in functions.

CHARACTER

Specifies character data. For more information on macro facility character data, refer to Character

data.

ENTRY Specifies that the identifier is a macro procedure. The declaration activates the entry name (as if an

ACTIVATE statement with the RESCAN option had executed) allowing implicit macro invocations to be

processed in subsequent source text.

Before a macro can be implicitly invoked in the source text, it must be active. To become active, a

macro must appear either in a %ACTIVATE statement if the macro procedure had appeared earlier or

in a %DECLARE statement.

See ANSWER and RETURN for further details.

FIXED Specifies fixed point data. For more information on macro facility fixed point data, refer to

Fixed-point data.

RESCAN

Specifies that the identifier is active and is replaced as many times as necessary.

SCAN Specifies that the identifier is active and is replaced only once in output.

NOSCAN

Specifies that the identifier is inactive and is not to be replaced in output.

dimension

Dimension specification for array variables.

lbound The desired lower bound for that dimension. The default is 1.

hbound

The desired upper bound for that dimension.

* The asterisk (*) specifications can only be made for EXTERNAL arrays and indicate that the

EXTERNAL array's actual dimensions have been declared elsewhere.

Use of the asterisk (*) removes the need to ensure that all declarations of an EXTERNAL array

have the same dimensions and extents.

No statement can refer to an array declared with * dimensions until a declaration with actual

extents has been made.

See the shared dimensions example. The dimension specification indicates the upper and lower

bound of each dimension.

INTERNAL

Causes the variable not to be shared with any other variable and to persist only for the life of a

macro invocation. If used in a %-declaration, the variable is not shared with a variable declared with

the same name in a macro procedure unless the variable is declared with the EXTERNAL attribute in

the macro procedure.

The INTERNAL default shown is in effect only when the SCOPE(INTERNAL) macro facility option is in

effect. Default is SCOPE(EXTERNAL) for compatibility.

EXTERNAL

Causes the variable to be shared with the same name declared in a %DECLARE statement.

    • %DO

The %DO statement, and its corresponding %END statement, delimit a macro facility %do-group.

Only type 1 do-groups are supported. For details, see DO statement.

    • %END

The %END statement ends a %do-group or a %PROCEDURE statement.

label Must be the label of the most recent open %PROCEDURE or %DO statement.

    • %GO TO

The %GO TO statement causes the scan to be resumed in the source text at the statement with the specified

label. The target statement must appear after the %GO TO statement. Backward %GO TO is not supported.

Abbreviation: %GOTO

label The label on the target statement.

The macro facility skips all text between the %GO TO statement and the point where the scan is resumed.

The skipped code must be syntactically correct.

    • %IF

The %IF statement allows the macro facility scan to be conditional.

relational-expression

Specifies the expression or expressions that are evaluated and tested to determine if the relations

expression is true or false. If the relational expression is true, the %THEN clause is executed and the

%ELSE clause, if present, is skipped. If false, the %THEN clause is skipped and the %ELSE clause, if

present, is executed.

%THEN clause

Specifies unit1 as a %do-group or any %statement, except %INCLUDE, %END, and %DECLARE.

%INCLUDE and %DECLARE must be enclosed in a %do-group.

%ELSE clause

Same as unit1.

All text that is skipped should be syntactically correct.

%IF statements can be nested in the same manner as described under IF statement.

    • %INCLUDE

The %INCLUDE directive is used to incorporate external text into the source program.

member

Specifies the name of the member to be included.

The included member can also contain %INCLUDE directives.

For information on how to detect or exclude multiply-included text, see %INCLUDE.

For information on using the %INCLUDE directive to include PL/I files at specified points in a compilation unit, refer to

the PL/I for OS/2 Programming Guide.

    • %NOTE

The %NOTE directive generates a diagnostic message of specified text and severity.

message

A character expression whose value is the required diagnostic message.

code A fixed expression whose value indicates the severity of the message, as follows:

If code is omitted, the default is 0.

If code has a value other than those listed above, a diagnostic message is produced; the resulting system

action is undefined.

Generated messages are filed together with other messages. Whether or not a particular message is subsequently

printed depends upon its severity level and the setting of the compiler FLAG option (as described in the PL/I for OS/2

Programming Guide).

Generated messages of severity U cause immediate termination of preprocessing and compilation. Generated messages

of severity S, E, or W might cause termination of compilation, depending upon the setting of various compiler options.

    • %null

The %null statement causes no operation to be performed and does not modify the flow of macro facility

scan.

    • %PROCEDURE

The %PROCEDURE statement begins a macro. It specifies the:

o Name of the macro

o Names of positional and keyword parameters

o Kind of macro (subroutine or function)

o Data type of the returned expression for function macros

Macro procedures cannot be nested within other macro procedures.

Note: A macro can be skipped as a result of processing a %GO TO or %IF-%THEN-%ELSE statement.

Abbreviations: PROC for PROCEDURE, CHAR for CHARACTER, STMT for STATEMENT

macro-name

Name of the macro.

positional-parameter-name

Name of parameter that can be specified as a positional parameter in the macro invocation. A positional

parameter cannot appear more than once. However, it can also appear in the KEYS option, in which case, it

can be specified either as a positional parameter or as a keyword parameter in a macro invocation.

(*)

Specifies a variable length positional parameter list allowing none or any number of positional parameters to

be specified on the macro invocation. All parameters are assumed to be of the CHARACTER type and none

can be named. The positional parameter list can be obtained by using the MACARGS built-in function and

processed by using the ITEM and ITEMCOUNT built-in functions. For additional information, see ITEM,

ITEMCOUNT, MACARGS, and Example 1.

KEYS

Specifies the names of keyword parameters.

keyword-parameter-name

Name of parameter that can be specified as a keyword parameter in the macro invocation. A keyword

parameter cannot appear more than once. However, it may also appear as a positional parameter, in

which case, it can be specified either as a positional parameter or as a keyword parameter in a macro

invocation.

default-value

Specifies the default value for the keyword. The value must be enclosed in quotes even if the keyword is

a FIXED data type.

STATEMENT

Specifies that any of the positional parameters can also be specified as keyword parameters in the macro

invocation. The STATEMENT option is exactly the same as the KEYS option with all of the positional

parameters explicitly specified.

This option is useful if the macro is sometimes invoked with positional parameters only, sometimes with

keyword parameters only, and sometimes with a combination of both.

RETURNS

Specifies that the macro is a function macro and specifies the attributes (CHARACTER or FIXED) of the

expression that are returned to the point of invocation using the RETURN statement.

The macro must return with a RETURN statement with an expression and must not use any ANSWER

statements.

A macro procedure, or macro, is delimited by a %PROCEDURE and a %END statement and contains zero or more of the following macro statements:

o ACTIVATE

o ANSWER

o assignment

o DEACTIVATE

o DECLARE

o DO

o END

o GO TO

o IF

o INCLUDE

o ITERATE

o LEAVE

o NOTE

o null

o OTHERWISE

o RETURN

o SELECT

The SELECT(exp1) form of the SELECT statement is not allowed.

o WHEN

A macro procedure must be processed before any invocations can occur. Note that macro procedures are not

processed if a %GO TO or a %IF-%THEN-%ELSE statement skips them.

    • ANSWER

The ANSWER statement produces text and/or invokes other macros. The answered text replaces the

invocation of the macro in the source text. You can use any number of ANSWER statements in a macro

procedure.

Abbreviations: ANS for ANSWER, COL for COLUMN, MAR for MARGINS

exp1

Represents a character expression that represents the ANSWER text. The ANSWER text can be

either a single character string constant or a macro facility expression of any complexity.

If it is an expression, the expression evaluation occurs in the usual manner and the result is

converted to a single character string.

If SCAN or RESCAN is in effect, the character string is scanned for replacements and macro

invocations. This replacement is done within the scope of the macro and not in the scope into

which the answered text is returned. The answered text is then inserted into the source at the

point of macro invocation. After the text is returned into the source, it is not scanned for any

replacement activity.

Replacement activity in the string follows the same rules as those for source text scanning and

replacement. See Example.

PAGE

Forces the answer text to be placed on a new page of the output source by generating a %PAGE

directive.

SKIP

Forces the answer text to be placed on a new line of the output source. The value of exp2

represents the arithmetic expression specifying the number of lines to be skipped. If exp2 is not

specified, the default value is 1.

RESCAN

Allows eligible macro identifiers to be replaced once or multiple times depending on their scanning

status (SCAN or RESCAN). For eligible macro identifiers, see %ACTIVATE and %DECLARE.

NOSCAN

Inhibits replacement of eligible macro identifiers.

SCAN

Allows eligible macro identifiers to be replaced only once regardless of their scanning status, that

is, SCAN and RESCAN status of an identifier is treated as SCAN. For eligible macro identifiers, see

%ACTIVATE and %DECLARE.

COLUMN

Specifies the starting column in the source program line in which the answer text is placed. The

value of exp3 represents the arithmetic expression for the column number of the source program

line where the answer text starts.

MARGINS

Specifies where the output text is placed within the output record. The value of exp4 represents

the arithmetic expression for the left margin for the output text. The value of exp5 represents the

arithmetic expression for the right margin for the output text.

The values specified for exp5 must be within the range returned by the MACLMAR (left margin) and

MACRMAR (right margin) built-in functions.

If you do not specify the MARGINS option for an ANSWER statement, the default value is

MARGINS(MACLMAR,MACRMAR); if you specify the MARGINS option with no operands, the default

value is MARGINS(MACCOL,MACRMAR).

You must not use both the RETURN statement with an expression and the ANSWER statement within the same macro.

(in procedures)

o Types 1, 2, and 4 DO statements are supported.

o Type 3 is also supported except for UPTHRU and DOWNTHRU. Furthermore, the "specification" cannot be

specified multiple times.

builtins.

    • Arithmetic built-in functions

³ MAX ³ Returns the maximum of one or more expressions ³

³ MIN ³ Returns the minimum of one or more expressions ³

    • Array-handling built-in functions

³ HBOUND ³ Returns the upper bound for a dimension of an array ³

³ LBOUND ³ Returns the lower bound for a dimension of an array ³

    • Date/time built-in functions

The date/time built-in function returns date and time information.

³ COMPILETIME ³ Returns a character string containing the date and time of the compilation

    • Macro invocation inquiry built-in functions

The macro invocation inquiry built-in functions return invocation specific information.

³ MACARGS ³ Returns the entire argument string ³

³ MACCOL ³ Returns the column number of the start of the macro invocation ³

³ MACECHO ³ Returns the text representing the macro invocation string ³

³ MACINDEX ³ Returns a number that is unique for the life of a macro invocation

³ MACPARMSET ³ Returns a fixed value of 1 if the parameter was specified in the macro invocation ³

³ PARMSET ³ See MACPARMSET ³

    • String-handling built-in functions

³ COMMENT ³ Converts a character string into a valid comment ³

³ INDEX ³ Returns a value that indicates the starting position of a ³

³ ³ character string within another character string ³

³ ITEM ³ Returns item y in x ³

³ ITEMCOUNT ³ Returns the number of items in x ³

³ LENGTH ³ Returns the current length of a string ³

³ QUOTE ³ Converts a character string into a valid quoted character string ³

³ REPEAT ³ Repeats a character string a specified number of times ³

³ SUBSTR ³ Returns a substring from a string ³

³ TRANSLATE ³ Returns a character string that is the translation of the input character string ³

³ VERIFY ³ Finds the position of the first character in the input string that is not present in the verification string

    • Miscellaneous built-in functions

³ COLLATE ³ Returns a character(256) string specifying the collating ³

³ ³ order ³

³ SYSPARM ³ Returns the character string value of the SYSPARM compiler ³

³ ³ option ³

³ SYSTEM ³ Returns a character string representation of the SYSTEM ³

³ ³ option in effect ³

³ SYSVERSION ³ Returns a character string indicating the version and ³

³ ³ release of the compiler ³

For examples of these built-in functions, see Macro procedures and invocations, the examples in this chapter, and

the appropriate PL/I built-in functions in PL/I for OS/2 Built-In Functions.

COMMENT returns a character string that represents x as a valid PL/I comment.

If x contains /* or */ composite symbols, they are replaced by /> and </, respectively.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄCOMMENT(x)ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

x Specifies the expression that is converted to a comment.

COMPILETIME returns a character string (of length 18) that represents the date and time of compilation in the

format DDbMMMbYYbHH.MI.SS, where:

DD The current day (a leading zero in DD is replaced by a blank)

MMM The current month (abbreviated as JAN, FEB, and so on)

YY The current year

HH The current hour

MI The current minute

SS The current second

b A blank character

. A period.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄCOMPILETIMEÄÂÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ÀÄ()ÄÙ ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

COUNTER returns a character string (of length 5) containing a numeric value with leading zeros.

The first reference returns a value of '00001'. Each subsequent reference returns a number one greater than

the previous reference.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄCOUNTERÄÂÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ÀÄ()ÄÙ ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

ITEM returns the y-th item in x. An item is defined to be a series of language elements or expressions

separated by commas. Any commas within parentheses, including the parentheses, are considered to be part

of the item. This is exactly like the specification in LIST-directed I/O without the DO specification. For more

information, see List-directed data specification.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄITEM(x,y)ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

x A character string that is one such item, however, the outermost parentheses if any, are ignored.

ITEMCOUNT returns the number of items in x.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄITEMCOUNT(x)ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

MACARGS returns the entire positional argument/parameter list specified in the invocation of the current

macro. The positional parameter list in such a macro is indicated by "(*)" on the procedure statement.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄMACARGSÄÄÂÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ÀÄ()ÄÙ ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

MACCOL returns a FIXED value that represents the column where the outermost macro invocation starts in

the source text that contains the macro invocation. The value returned is not affected by nested macro

invocations.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄMACCOLÄÄÂÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ÀÄ()ÄÙ ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

MACECHO returns a character string representing the text that was used to invoke the macro.

Regardless of how the macro was invoked, the string returned is always delimited by the trigger character (?)

and a semicolon (;).

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄMACECHOÄÄÂÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ÀÄ()ÄÙ ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

MACINDEX returns a 4-digit character string that is unique and remains consistent for the life of a macro

invocation. Its value can be used to create unique variable names in macro generated code.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄMACINDEXÄÄÂÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ÀÄ()ÄÙ ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

MACLMAR returns a FIXED value that represents the column number of the left source margin in MARGINS

compiler option. See the MARGINS option in the PL/I for OS/2 Programming Guide.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄMACLMARÄÄÂÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ÀÄ()ÄÙ ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

MACPARMSET returns a FIXED value of 1 if the parameter named was explicitly specified in the invocation of

the macro. Otherwise 0 is returned.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄMACPARMSETÄÄ(x)ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

x

Name of the parameter.

MACRMAR returns a FIXED value that represents the column number of the right source margin in MARGINS

compiler option. See the MARGINS option in the PL/I for OS/2 Programming Guide.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄMACRMARÄÄÂÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ÀÄ()ÄÙ ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

QUOTE returns a character string that represents x as a valid quoted string.

If x contains single quotation marks, each is replaced by two consecutive single quotation marks.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄQUOTE(x)ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

x Character expression that is converted to a quoted string.

SYSPARM returns the character string value of the SYSPARM compiler option. The value returned is not

translated to uppercase; the exact value as specified in the compiler option is returned. For more information,

see the description of the SYSPARM compiler option in the PL/I for OS/2 Programming Guide.

SYSPARM allows information external to the program to be accessed without modifying the source program.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄSYSPARMÄÂÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ÀÄ()ÄÙ ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

SYSTEM returns a character string that contains the value of the SYSTEM compiler option that is in effect.

See the description of the SYSTEM compiler option in the PL/I for OS/2 Programming Guide.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄSYSTEMÄÂÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ÀÄ()ÄÙ ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

SYSVERSION returns a character string (of length 31) indicating the name of the compiler and the version,

release, and modification level.

The format of the string is:

PL/Ibbbbbvvrrmmbxxxxxxxxxxxxxxx

inwhich :

PL/I The compiler name (PL/I)

b Indicates a single blank

vvrrmm Is the compiler version (vv), release (rr), and modification level (mm)

xx...xx Reserved for future use.

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿

³ ³

³ >>ÄÄSYSVERSIONÄÂÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>< ³

³ ÀÄ()ÄÙ ³

³ ³

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

The macro facility reserves some keywords that have specific meaning to it. Reserved keywords cannot be used as

identifier names.

Macro facility reserved words are shown in Macro facility keywords.

³ KEYWORD ³ ABBREVIATION ³ IN % STATEMENTS ³ IN MACRO PROCEDURES

³ ACTIVATE ³ ACT ³ Reserved ³ Reserved ³

³ ANSWER ³ ANS ³ ³ Reserved ³

³ CONTROL ³ ³ Reserved ³ ³

³ DEACTIVATE ³ DEACT ³ Reserved ³ Reserved ³

³ DECLARE ³ DCL ³ Reserved ³ Reserved ³

³ DO ³ ³ Reserved ³ Reserved ³

³ ELSE ³ ³ Reserved ³ Reserved ³

³ END ³ ³ Reserved ³ Reserved ³

³ FOREVER ³ ³ Reserved ³ Reserved ³

³ GO TO ³ GOTO ³ Reserved ((Note ³ Reserved ((Note ³

³ ³ ³ 1)) ³ 1)) ³

³ IF ³ ³ Reserved ³ Reserved ³

³ INCLUDE ³ ³ Reserved ³ Reserved ³

³ ITERATE ³ ³ ³ Reserved ³

³ LEAVE ³ ³ ³ Reserved ³

³ LOOP ³ ³ Reserved ³ Reserved ³

³ MACRO ³ ³ Reserved ³ ³

³ NOPRINT ³ ³ Reserved ³ ³

³ NOSCAN ³ ³ Reserved ³ Reserved ³

³ NOTE ³ ³ Reserved ³ Reserved ³

³ NOTEST ³ ³ Reserved ³ ³

³ OPTION ³ ³ Reserved ³ Reserved ³

³ OTHERWISE ³ OTHER ³ Reserved ³ Reserved ³

³ PAGE ³ ³ Reserved ³ ³

³ POP ³ ³ Reserved ³ ³

³ PRINT ³ ³ Reserved ³ ³

³ PROCEDURE ³ PROC ³ Reserved ³ ³

³ PUSH ³ ³ Reserved ³ ³

³ RESCAN ³ ³ Reserved ³ Reserved ³

³ RETURN ³ ³ ³ Reserved ³

³ SELECT ³ ³ Reserved ³ Reserved ³

³ SKIP ³ ³ Reserved ³ ³

³ THEN ³ ³ Reserved ³ Reserved ³

³ TEST ³ ³ Reserved ³ ³

³ WHEN ³ ³ Reserved ³ Reserved ³