Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Macro Command Language Processor macros

&pagelevel(3)&pagelevel

Only the data area is generated. Each field is assigned a field name and explanatory equates, if required. The data area ends with a length equate. Initialization values must usually be entered in the standard header by the user.

(C,pre)
This specification is permitted only in format 1. The user can define the first characters of the field names and equates by specifying a prefix pre.
pre = 1..4 characters.

C [,PREFIX=p][,MACID=mac]
This specification is permitted only in MF formats 2 and 3. The PREFIX operand allows the user to define the first character of the field names and equates. p = 1 letter.
The MACID operand allows the user to define the second, third and fourth characters of the field name and equates. mac = 1..3 characters.
No other operands are evaluated in the C form.

D (D form)
A DSECT is generated. Each field is assigned a field name and explanatory equates, if required. The DSECT ends with a length equate. No switch to the initial location counter is effected.
The DSECT describes the structure of a memory area but does not occupy any memory space itself. The symbolic name specified with DSECT is entered in an ESD record (External Symbol Dictionary record). The location counter is set to zero.

(D,pre)
This specification is permitted only in MF format 1. The user can define the first characters of the field name and equates by specifying a prefix pre.
pre = 1..4 characters.

D [,PREFIX=p]
This specification is permitted only in MF formats 2 and 3. The user can define the first character of the field names and equates by specifying a prefix p. p = 1 letter.
No other operands are evaluated in the D form.

L (L form)
Only the data area is generated, taking the operand values specified in the macro into account. The data area contains no field names and no explanatory equates. The initialization values are entered in the standard header. The macro is contained in the definition section of the program. If it contains variable data, this form of macro must not be written in the reentrant portion of the program when shared-code programming is employed. The data area is initialized with constant values in the reentrant portion of the program, copied to a data area specific to the program run before the E-form call and modified there if necessary. Modification can be carried out, for example, with the M form, if it is available for the interface involved.

E (E form)
Only the instructions required for calling the functional module are generated. The instruction part usually ends with an SVC. The macro must indicate the address of the data area containing the operand values.

(E,addr) / (E,(r))
This specification is permitted only in MF format 1.
addr = Assembler name (address of the data area).
r = register containing the address of the data area. The register must be loaded with this address value before the macro is called.

E [,PARAM=addr / (r)]E [,PARAM=<var: pointer> / (<reg: pointer>)]

The PARAM operand specifies the address of the data area. This specification is permitted only in MF formats 2 and 3.
addr = Assembler name (address of the data area).
r = register containing the address of the data area. The register must be loaded with this address value before the macro is called.
If no other specification is made, the default setting is: PARAM = (1)
No other operands are evaluated in the E form.

M (M form)
This operand value may be specified only in MF formats 2 and 3.
Instructions (e.g. MVCs) are generated which, while the program is running, use the operand values which are specified in the macro to overwrite fields in a data area already initialized with MF=L or, in the case of shared code programming, in a copy of the data area initialized with MF=L local to the program run. This is how the M form conveniently enables the operand values with which a macro is called to be dynamically matched with the program run.
If MF=M is specified, no default values are accepted for functional operands, i.e. all operands must be specified explicitly
Since the instructions generated with MF=M use the symbolic addresses and equates of the C form or D form, it must be established when using the M form that these names are available for addressing the data area to be modified. It is particularly important to ensure that for a macro with MF=M any PREFIX and MACID operands are specified with the same values as those in the associated MF=C or MF=D call.

M [,PREFIX=p][,MACID=mac]
The PREFIX operand allows the user to define the first character of the field names and equates.
p = 1 letter.
The MACID operand allows the user to define the second, third and fourth characters of the field name and equates.
mac = 1..3 characters.

M [,PARAM=addr / (r)]M [,PARAM=<var: pointer> / (<reg: pointer>)]

The PARAM operand specifies the address of the data area. This specification is permitted only in MF format 2.
addr / <var: pointer> = Assembler name (address of the data area).
r / (<reg: pointer>) = register containing the address of the data area. The register must be loaded with this address value before the macro is called.
Default setting: PARAM = (1)

R (R form)
This operand value may be specified only in MF format 3.
The operand values (of output parameters) specified by means of functional operands are read from the data area and stored in variables of the application program.
Since the instructions generated for this purpose use the symbolic addresses and equates of the C form or D form, it must be established when using the R form that these names are available for addressing the data area to be modified. It is particularly important to ensure that for a macro with MF=R any PREFIX and MACID operands are specified with the same values as those in the associated MF=C or MF=D call.

R [,PREFIX=p][,MACID=mac]
The PREFIX operand allows the user to define the first character of the field names and equates.
p = 1 letter.
The MACID operand allows the user to define the second, third and fourth characters of the field names and equates.
mac = 1..3 characters.

Example 1: RDATA macro (MF format 1) with S form (standard form)

  RDATA1   START
           LDBASE R3,0
1                 *,MACRO: LDBASE, VERSION: VER021                    021
1          ##BALR R3,0                                                020
2          BASR  R3,0                                                 012
           USING *,R3
  RDATA1   AMODE ANY
  RDATA1   RMODE ANY
           GPARMOD 31
1                 *,MACRO: GPARMOD, VERSION: VER121
           PRINT GEN
           RDATA INAREA,STOP  ——————————————————————————————————————————  (1) 
1          ##SPASS  S0004S,S0004D                                    A312
2          CNOP  0,4
2          BAS   1,S0004S           ADDRESS AND SKIP PARAMS
1 S0004D     DS 0F                                                   A340
1          FHDR  UNIT=36,FUNCT=18,VERS=2
2          DS    0A
2          DS    0XL8                GENERAL OPERAND LIST HEADER
2          DC    AL2(36)             FUNCTION UNIT NUMBER
2          DC    AL1(18)             FUNCTION NUMBER
2          DC    AL1(2)              FUNCTION INTERFACE VERSION NUMBER
2          DC    X'FFFFFFFF'          Returncode is virgin
1 *
1          DC    A(STOP)                  ERROR ADDRESS
1          DC    AL4(INAREA)              READ IN AREA ADDRESS
1          DS    AL1(0)                   PLACE FOR I.EDIT BYTE 1
1          DS    AL1(0)                   PLACE FOR I.EDIT BYTE 2
1          DC    AL1(0)                   SYSDTA ASSIGNMENT
1          DC    AL1(0)                   FLAG BYTE 1
1          DC    AL2(L'INAREA)           LENGTH OF READ
1          DC    AL1(0)                  FLAG TABLE BYTE
1          DC    AL1(0)                  ASSIGNMENT CHANGE INDICATOR
1          DC    H'0'                    KEY-POSITION
1          DC    H'0'                    KEY-LENGTH
1          DC    AL4(0)                  VTSUCB ADDRESS
1          DC    AL2(0)                  INPUT TIMER VALUE            009
1          DC    H'0'                    RES_FOR_TIAM                 007
1 *
1          @DCEI DCEDIT=,MODE=,IGETFC=,ICFD=,                            C
1                ITRSUP=,ILINEND=,IGETBS=,                               C
1                IMANUAL=,ILCASE=,IHDR=,                                 C
1                IGETIC=,RDA1=-20,RDA2=-19
2          ORG   *-20
2          DC    AL1(0)
2          ORG   *+20-1
2          ORG   *-19
2          DC    AL1(0)
2          ORG   *+19-1
2                *,@DCEI      999    921011   53531002
1 S0004S     DS 0Y                                                   A340
1          SVC   39                      SYSFILE SVC
1 *
           PRINT NOGEN
  STOP     TERM
  *
  INAREA   DS    CL104
  R3       EQU   3
           END

(1)

The standard form is the default setting for the RDATA macro and is selected by omitting the MF operand. All operands required must be specified. The instruction part and data area are generated.

Example 2: RDATA macro (MF format 1) with E and L form

  RDATA2   START
           LDBASE R3,0
1                 *,MACRO: LDBASE, VERSION: VER021                    021
1          ##BALR R3,0                                                020
2          BASR  R3,0                                                 012
           USING *,R3
  RDATA2   AMODE ANY
  RDATA2   RMODE ANY
           GPARMOD 31
1                 *,MACRO: GPARMOD, VERSION: VER121
           PRINT GEN
           RDATA MF=(E,PARLIST) ———————————————————————————————————————  (1) 
1          LA    1,PARLIST               LOAD ADDR PARAM LIST INTO R1
1          SVC   39                      SYSFILE SVC
1 *
           PRINT NOGEN
  STOP     TERM
  *
  INAREA   DS    CL104
           PRINT GEN
  PARLIST  RDATA INAREA,STOP,MF=L —————————————————————————————————————  (2) 
1 S0007D     DS 0F                                                   A340
1 PARLIST  FHDR  UNIT=36,FUNCT=18,VERS=2
2          DS    0A
2 PARLIST  DS    0XL8                GENERAL OPERAND LIST HEADER
2          DC    AL2(36)             FUNCTION UNIT NUMBER
2          DC    AL1(18)             FUNCTION NUMBER
2          DC    AL1(2)              FUNCTION INTERFACE VERSION NUMBER
2          DC    X'FFFFFFFF'          Returncode is virgin
1 *
1          DC    A(STOP)                  ERROR ADDRESS
1          DC    AL4(INAREA)              READ IN AREA ADDRESS
1          DS    AL1(0)                   PLACE FOR I.EDIT BYTE 1
1          DS    AL1(0)                   PLACE FOR I.EDIT BYTE 2
1          DC    AL1(0)                   SYSDTA ASSIGNMENT
1          DC    AL1(0)                   FLAG BYTE 1
1          DC    AL2(L'INAREA)           LENGTH OF READ
1          DC    AL1(0)                  FLAG TABLE BYTE
1          DC    AL1(0)                  ASSIGNMENT CHANGE INDICATOR
1          DC    H'0'                    KEY-POSITION
1          DC    H'0'                    KEY-LENGTH
1          DC    AL4(0)                  VTSUCB ADDRESS
1          DC    AL2(0)                  INPUT TIMER VALUE            009
1          DC    H'0'                    RES_FOR_TIAM                 007
1 *
1          @DCEI DCEDIT=,MODE=,IGETFC=,ICFD=,                            C
1                ITRSUP=,ILINEND=,IGETBS=,                               C
1                IMANUAL=,ILCASE=,IHDR=,                                 C
1                IGETIC=,RDA1=-20,RDA2=-19
2          ORG   *-20
2          DC    AL1(0)
2          ORG   *+20-1
2          ORG   *-19
2          DC    AL1(0)
2          ORG   *+19-1
2                *,@DCEI      999    921011   53531002
1 *
           PRINT NOGEN
  R3       EQU   3
           END

(1)

The E form of the macro generates the instruction part of the RDATA macro. The data area with the desired operands starts at the symbolic address PARLIST.

(2)

All desired operands are specified in the L form of the macro. The data area is generated.

Example 3: GTIME macro (MF format 3) with D, E, M and L form

  GTIME    START
           PRINT NOGEN
           BALR  R3,0
           USING *,R3
  GTIME    AMODE ANY
  GTIME    RMODE ANY
           LA    R5,GLIST —————————————————————————————————————————————  (1) 
           USING DGLIST,R5
           LA    R13,SAVE
  *
  E1       GTIME MF=E,PARAM=GLIST,LINKADR=*NONE ———————————————————————  (2) 
           MVC   TEXT,='Date: ' ———————————————————————————————————————  (3) 
           MVC   DATE,NTIGDTIC
           WROUT OUTPUT,STOP
2                *,@DCEO      999    921011   53531004
  CLEAR    MVC   DATE,=CL10' '
  *
  M        GTIME MF=M,PARAM=GLIST,DAY=YES —————————————————————————————  (4) 
  *
  E2       GTIME MF=E,PARAM=GLIST,LINKADR=*NONE ———————————————————————  (5) 
           MVC   TEXT,='Day:  ' ———————————————————————————————————————  (6) 
           MVC   DAY,NTIGDYID
           WROUT OUTPUT,STOP
2                *,@DCEO      999    921011   53531004
  STOP     TERM
  *
  OUTPUT   DC    Y(OUTPUTE-OUTPUT)
           DC    X'404001'
  TEXT     DS    CL6
  DATE     DS    CL10
           ORG   DATE
  DAY      DS    CL2
           ORG
  OUTPUTE  EQU   *
  SAVE     DS    18F
  GLIST    GTIME MF=L,DATE=YES ————————————————————————————————————————  (7) 
           PRINT GEN
  DGLIST   GTIME MF=D —————————————————————————————————————————————————  (8) 
1 DGLIST   MFTST MF=D,PREFIX=N,MACID=TIG,ALIGN=F,                        C
1                DMACID=TIG,SUPPORT=(E,D,C,M,L),DNAME=TIG_MDL
2 DGLIST   DSECT ,
2                *,##### PREFIX=N, MACID=TIG #####
1 *   subcodes
1 NTIGERROR_IN_CALL      EQU   1           Error in Call
1 NTIGRNAP               EQU   32          no Action possible
1 NTIGWARNING_SITUATION  EQU   512         Warning Situation (SPL)
1 NTIGRWCS               EQU   2           Warning Situation (ASS)
1 *
1 *   GTIME-Parameter-Area
1 NTIGFHDR FHDR  MF=(C,NTIG),EQUATES=NO                    Standardheader
2 NTIGFHDR DS    0A
2 NTIGFHE  DS    0XL8            0   GENERAL PARAMETER AREA HEADER
2 *
2 NTIGIFID DS    0A              0   INTERFACE IDENTIFIER
2 NTIGFCTU DS    AL2             0   FUNCTION UNIT NUMBER
2 *                                  BIT 15    HEADER FLAG BIT,
2 *                                  MUST BE RESET UNTIL FURTHER NOTICE
2 *                                  BIT 14-12 UNUSED, MUST BE RESET
2 *                                  BIT 11-0  REAL FUNCTION UNIT NUMBER
2 NTIGFCT  DS    AL1             2   FUNCTION NUMBER
2 NTIGFCTV DS    AL1             3   FUNCTION INTERFACE VERSION NUMBER
2 *
2 NTIGRET  DS    0A              4   GENERAL RETURN CODE
2 NTIGSRET DS    0AL2            4   SUB RETURN CODE
2 NTIGSR2  DS    AL1             4   SUB RETURN CODE 2
2 NTIGSR1  DS    AL1             5   SUB RETURN CODE 1
2 NTIGMRET DS    0AL2            6   MAIN RETURN CODE
2 NTIGMR2  DS    AL1             6   MAIN RETURN CODE 2
2 NTIGMR1  DS    AL1             7   MAIN RETURN CODE 1
2 NTIGFHL  EQU   8               8   GENERAL OPERAND LIST HEADER LENGTH
2 *
1 *   main return codes
1 NTIGRNIN               EQU   1           GTIME function not
1 *                                        initialized
1 NTIGRNSI               EQU   2           no season information
1 NTIGRPRV               EQU   16          no previous change date known
1 NTIGRPST               EQU   17          no later change date in past
1 *                                        known
1 NTIGRNCD               EQU   18          no change date known
1 NTIGRXIE               EQU   8           internal error concerning
1 *                                        xcs_mode
1 *
1 NTIGIB1                DS    AL1         indicator byte 1
1 NTIGIMU                EQU   X'80'       MODE = UTC
1 NTIGIFB                EQU   X'40'       FORMAT = BIN
1 NTIGICS                EQU   X'20'        not used
1 NTIGIFT                EQU   X'10'       FORMAT = TODR
1 NTIGIDW                EQU   X'08'       date wanted
1 NTIGIWW                EQU   X'04'       day wanted
1 NTIGITW                EQU   X'02'       TOD wanted
1 NTIGIZW                EQU   X'01'       zone wanted
1 NTIGIB2                DS    AL1         indicator byte 2
1 NTIGIRM                EQU   X'80'       resolution = microsec.
1 NTIGICN                EQU   X'40'       next change date demanded
1 NTIGICP                EQU   X'20'       previous ch.date demanded
1 NTIGIRF                EQU   X'10'       time reference
1 NTIGIMX                EQU   X'08'       global XCS-time on
1 NTIGICA                EQU   X'04'       announcement of chdate
1 *                                        demanded
1 NTIGRESERVED_2BITS     EQU   X'03'       not yet used
1 NTIGIRES               DS    XL2          indicator byte 3 & 4
1 NTIGDATE_UNION         DS    0XL16       date_union
1 NTIGDATE_SPL           DS    XL16        for SPL
1          ORG   NTIGDATE_UNION
1 *
1 NTIGDTI                DS    0XL16       date_iso4
1 NTIGDATE_UN            DS    0XL10       date union
1 *
1 NTIGDATE_1             DS    0XL10       date struct
1 NTIGDTIY               DS    CL4         year
1 NTIGDTI1               DS    CL1         hyphen1
1 NTIGDTIM               DS    CL2         month
1 NTIGDTI2               DS    CL1         hyphen2
1 NTIGDTID               DS    CL2         day
1 *
1          ORG   NTIGDATE_UN
1 NTIGDTIC               DS    CL10        date_char
1          ORG   NTIGDATE_UN+10
1 NTIGDTIJ               DS    CL3         julian date
1 NTIGDTIB               DS    CL1         blank
1 NTIGDYID               DS    CL2         weekday in ISO4
1 *
1          ORG   NTIGDATE_UNION
1 *
1 NTIGDTB                DS    0XL16       date_bin
1 *
1 NTIGDATE_2             DS    0XL6        date
1 NTIGDTBY               DS    H           year
1 NTIGDTBM               DS    H           month
1 NTIGDTBD               DS    H           day
1 *
1 NTIGDTBJ               DS    H           Julian date
1 NTIGFILL_6             DS    XL6         fill for weekday
1 NTIGDYBD               DS    H           weekday bin.: MO=0, DI=1, ...
1 *                                        SO=6
1 * 
.
.
.

Runtime log

/start-assembh
%  BLS0500 PROGRAM 'ASSEMBH', VERSION '<ver>' OF '<date>' LOADED
%  ASS6010 <ver> OF BS2000 ASSEMBH  READY 
//compile source=*library-element(macexmp.lib,gtime), -
//        compiler-action=module-generation(module-format=llm), -
//        module-library=macexmp.lib, -
//        listing=parameters(output=*library-element(macexmp.lib,gtime))
%  ASS6011 ASSEMBLY TIME: 538 MSEC
%  ASS6018 0 FLAGS, 0 PRIVILEGED FLAGS, 0 MNOTES
%  ASS6019 HIGHEST ERROR-WEIGHT: NO ERRORS
%  ASS6006 LISTING GENERATOR TIME: 135 MSEC
//end
%  ASS6012 END OF ASSEMBH
/start-executable-program library=macexmp.lib,element-or-symbol=gtime
%  BLS0523 ELEMENT 'GTIME', VERSION '@' FROM LIBRARY
   ':2OSG:$QM212.MACEXMP.LIB' IN PROCESS
%  BLS0524 LLM 'GTIME', VERSION ' ' OF '<date> <time>' LOADED
Date: 2012-01-20
Day:  FR

(1)

Register R5 is loaded with the address of the data area created with MF=L and used to address the parameter list.

(2)

The call GTIME MF=E will generate the command section.The data area with the operand values starts as of the symbolic address GLIST: The current date (DATE=YES) should be determined (see also point (7)).

(3)

The output area will be filled in with the text “Date:”, and the contents of the field NTIGDTIC. The field NTIGDTIC is part of the DSECT and of the data area GLIST and contains the current date. The desired information will be output with the WROUT macro.

(4)

The call GTIME MF=M will dynamically modify the GLIST data area. Additionally the current day (DAY=YES) should now be output.

(5)

The call GTIME MF=E will generate the command section.The data area with the operand values again starts as of the symbolic address GLIST: The current day (DAY=YES) should now be determined (see also point (7)).

(6)

The output area will be filled with the text “Day:” and the contents of the field NTIGDYID. The field NTIGDYID is part of the DSECT and of the modified data area GLIST and contains the current day after a claa with MF=E has been issued. The desired information will be output with the WROUT macro.

(7)

The call GTIME MF=L generates the data area for operand values. The data area starts as of the symbolic address GLIST. The first time GTIME MF=E is called, the information DATE will be queried (see point (2)). The second time GTIME MF=E is called, the data area has been changed with a previous call GTIME MF=M, so that the desired information is now also DAY (see points (4) and (5)).

(8)

The DSECT for GTIME is generated.The data area can be completed by using the field name of the DSECT. The field names begin by default with the characters NTIG.The calculation of addresses in DGLIST once again begins with X'000000'. The subsequent offsets are addressed with the base register R5 (e.g. in MVCs).