z/OS DFSMSdfp Advanced Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Determining DFARELS During Assembler Macro Phase

z/OS DFSMSdfp Advanced Services
SC23-6861-01

Your program can test the DFARELS field during execution as described earlier. This does not allow you to assemble a program that optionally uses a new macro parameter that is available only on a certain level of the system. Your program receives syntax error messages if assembled on an older level of the system.

A solution is to test a macro variable symbol set by the IHADFA macro. The name of the symbol is &IHADFARELS and it is a character type of global variable symbol. Your program's test of its value must follow the IHADFA invocation.

The other system facilities determine whether your program can run on a different release than the one on which it was assembled. For some new functions the older release will ignore the new function. Other new functions will fail on an older release.

The IHADFA macro sets the variable symbol &IHADFARELS to an eight-character value. Each pair of characters in the value represents the decimal value of one byte in DFARELS. They are not hexadecimal digits because the EBCDIC values of "A" to "F" are not in proper collating sequence with the numeric digits. For example the value for z/OS® Version 1 Release 10 is ' 03011000', '03' represent the name z/OS, ' 01' represents Version 1, ' 10' represents release 10, ' 00' represents modification level 0.

This is an example of a program using &IHADFARELS:

Figure 1. Sample &IHADFARELS Program
 xxxx    CSECT
           .
           .
           .
         GBLC  &IHADFARELS    Set by IHADFA macro to be system level
         IHADFA ,             Set &IHADFARELS and define DFARELS
 xxxx    CSECT                Reset CSECT
           .
           .
           .
* Expand one of two macro invocations.  Either works on any DFSMS
* release.  If in 31-bit mode on 1.3 or later, then ANY means a UCB
* may be above the line.  Neither works on DFP Version 3 when assembled
* on DFSMS.
         AIF   ('&IHADFARELS' LT '01010300').OLD
* If executing in 31-bit mode on 1.3 or later, this requires that each
* UCB address be 31-bit.  They may point below the line.  On an older
* level of DFSMS, the ANY has no effect.  DFP 3.x will reject it.
         DEVTYPE UCBLIST=(MYLIST,1,ANY),MF=(E,DEVTLIST)
         AGO   .CONT
.OLD     DEVTYPE UCBLIST=(MYLIST,1),MF=(E,DEVTLIST)
.CONT    ANOP
          .
MYLIST   DC    A(0)
DEVTLIST DEVTYPE ,(DEVINFO,24),MF=L

The IHADFA macro as shipped prior to DFSMS/MVS V1R3 did not set &IHADFARELS. You can use the technique in the example even if IHADFA does not set &IHADFARELS.

This technique of using IHADFA to decide on another macro invocation assumes that IHADFA resides in a complete macro library for the same release as the other macro. It might not work properly with a macro from a different release or product.

Following is an example of determining whether a mapping macro has defined a symbol that is needed during the assembly. During execution, the program tests DFARELS to determine how to execute.

Figure 2. Example of Determining Symbol Definition
          GBLC  &IHADFARELS   Set by IHADFA macro to be system level
          IHADFA ,            Learn release of assembly & execution
 TRKLIST  DSECT
          TRKCALC MF=D        DSECT for TRKCALC parameter list
          SPACE 2
 * If global symbol &IHADFARELS has a null value or is less than
 * 01010300, then TRKCALC did not define a certain symbol.  Since
 * other parts of this program use it, it must be defined.
          AIF   ('&IHADFARELS' GE '01010300').GOTBIT   Go if newer
 STARLOC  EQU   X'01'     LOC=ANY.  DEVTAB or UCB may be above line
 .GOTBIT  ANOP

 

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014