SPLEVEL — Set macro level

Description

Use the SPLEVEL macro to ensure that the assembler generates the correct level for a particular macro that your program issues. You might need to control the level of a macro expansion if you assemble your program on one version and release of MVS™, then run the program on a different version and release of MVS, and one of the following is true:
  • Your program issues MVS macros that are downward incompatible to MVS/System Product Version 1.
  • Your program issues installation- or vendor-written macros that are incompatible between versions and releases.
See Compatibility of MVS macros for additional information about the downward incompatible MVS macros. Authorized callers of SPLEVEL should consult “Selecting the Macro Level” in the following for the lists of downward incompatible MVS macros that are authorized:

For installation- or vendor-written macros, see the installation or vendor information to determine if incompatibilities between versions and releases exist.

You can use SPLEVEL in two ways:
  • Within your program, issue SPLEVEL with the SET=n parameter prior to issuing another macro to set the desired level for that macro. SPLEVEL SET=n sets a global symbol (&SYSSPLV) to the value n. Certain macros (including all the downward incompatible macros) check this global symbol during assembly to determine which expansion of the macro to generate. Once you set the macro level, all macros in your program that check the &SYSSPLV global symbol expand at that level until you change the level to some other value.
    Authorized callers of SPLEVEL should consult the Macro Summary in the chapter entitled “Using the Macros” in the following publications for the lists of authorized macros that check the SPLEVEL global symbol:

    See High Level Assembler Language Reference for information about global set symbols.

  • Within a macro you are writing, issue SPLEVEL with the TEST parameter to ensure that the macro level is set:
    1. Define the &SYSSPLV global symbol within your macro.
    2. Issue SPLEVEL TEST, which checks to see if the caller set the macro level.
    3. Define different logical paths within your macro to correspond to the macro level that is in effect.

Existing programs that were assembled using Version 2, Version 3, Version 4, and Version 5 macros will run properly on z/OS®.

Environment

The requirements for the caller are:

Environmental factor Requirement
Minimum authorization: Problem state and any PSW key.
Dispatchable unit mode: Task or SRB
Cross memory mode: Any PASN, any HASN, any SASN
AMODE: 24- or 31-bit
ASC mode: Primary or access register (AR)
Interrupt status: Enabled or disabled for I/O and external interrupts
Locks: The caller may hold locks, but is not required to hold any.
Control parameters: None.

Programming requirements

None.

Restrictions

None.

Input register information

Before issuing the SPLEVEL macro, the caller does not have to place any information into any register unless using it in register notation for a particular parameter, or using it as a base register.

Output register information

When control returns to the caller, the general purpose registers (GPRs) and access registers (ARs) are all unchanged.

Performance implications

None.

Syntax

The SPLEVEL macro is written as follows:

Syntax Description
   
   name name: Symbol. Begin name in column 1.
   
One or more blanks must precede SPLEVEL.
   
SPLEVEL  
   
One or more blanks must follow SPLEVEL.
   
   TEST  
   
   SET=n n: 2, 3, 4, 5 or 6
   SET Default: SET=6
   

Parameters

The parameters are explained as follows:

TEST
TEST checks the &SYSSPLV global variable, and does the following:
  • Sets &SYSSPLV to the default value if &SYSSPLV does not contain a value indicating that you did not issue SPLEVEL SET during this assembly.
  • Leaves the value of &SYSSPLV unchanged, if &SYSSPLV does contain a value indicating that you issued SPLEVEL SET during this assembly.
SET=n
SET
Specifies the macro level by setting the global symbol &SYSSPLV.
  • SET=n places a value in &SYSSPLV equal to n, where n must be 2, 3, 4, 5 or 6.
  • SET without n, results in the assembler using the default value, 6.

ABEND codes

None.

Return and reason codes

None.

Example 1

Select the version 1 expansion of a specific downward incompatible macro.
SPLEVEL SET=1

Example 2

Use SPLEVEL TEST within your own macro to ensure the &SYSSPLV global symbol is set.
         .
         .
         .
         GBLC     &SYSSPLV                 Define global symbol
         SPLEVEL  TEST                     If global symbol has no value,
                                           set to the default.
         AIF      ('&SYSSPLV' EQ '1').V1   Use code for V1
 .V5     ANOP     This logical path contains instructions appropriate
                  for a V2, V3, V4, or V5 expansion.
         .
         .
         .
         AGO      .COMMON
 .V1     ANOP     This logical path contains instructions appropriate
                  for a V1 expansion.
         .
         .
         .
 .COMMON ANOP