General
| Application area: | Requesting and accessing lists and tables; see "Requesting and accessing lists and tables" | 
| Macro type: | Type S, MF format 1: 31-bit interface: standard/E/L/D form; see "S-type macros" | 
Resources whose utilization is to be measured are defined in so-called information packages. The following information packages can be selected for measuring:
| Designation | Resources/Measured values | 
| Global values | CPU time, total number of inputs and outputs, number of data blocks  | 
| Time usage | CPU time, time stamp or run time are determined. | 
| Input/output count | Number of inputs and outputs. | 
A description of the structure of the output fields for the individual information packages follows after the description of the macro format.
Working set integral: Sum of all products of (main memory pages in Kbytes * user time in seconds). 
Number of data blocks transferred: transport of data to and from the local periphery, in PAM pages (for public, system private and user private disks) or in 2K blocks (for magnetic tapes and unit record devices).
Macro description
The AINF macro determines the resource utilization of a job and passes the values to a user program area.
Two methods are available for measuring resource utilization:
- Usage stamp method: 
 Resource utilization since the beginning of the job (format 1)
- Measurement method: 
 Resource utilization of individual program sections (formats 2 and 3)
The MF=D operand generates a DSECT for the data area and a definition of possible return information items. Additionally, the AINF macro may output the definitions of the output structure of individual information packages (format 4).
Note
The CPU time consumed by the system call processing itself corrupts the measurement slightly.
Functional description
When the usage stamp method is used, the AINF macro determines resource usage since the beginning of the job and transfers the usage values to a user program area. The user selects the resource to be measured by specifying information packages in the macro (GLOBAL, TIME, IOCNT) to which different resources are assigned.
When the measurement method is used, the AINF macro determines the resource usage of individual program sections. Measurement may be started, interrupted, continued or terminated at freely selectable points in the program. Several measurements may be nested and overlap as required. Each measurement is assigned its own measurement ID in order to allow unique identification of different measurements.
When a measurement is started (READY operand), the user defines a measurement ID and selects the information packages containing the resources to be measured. If the measurement is to be interrupted, the user must issue another AINF call (with the INTR operand) at the point where the interrupt is to take place. The system determines the usage values of the specified resources since the start of the measurement and transfers them, if desired, to a user program area. To continue the interrupted measurement, the user must issue an AINF call (with the READY operand) containing the associated measurement ID at the desired point. In this way, a measurement may be interrupted whenever desired and continued later on. Following each interrupt, the system determines the total of the usage values of all measurement steps up to this point.
Measurement is terminated when an AINF call (with the FINISH operand) is issued or the program is terminated. The system transfers the total of the usage values of all measuring steps (from the start of measurement to the end) to a user program area.
AINF data area format:
| Field name | Displacement | Contents | 
| 
 | 
 | Macro ID | 
| 
 | 
 | Function selection | 
| 
 | 
 | Operand type | 
| 
 | 
 | Output area | 
| 
 | 
 | Chaining address | 
| 
 | 
 | Measurement ID | 
Macro formats and description of operands
The operands of the following descriptions are described in alphabetical order.
Format 1: Usage stamp method
| AINF | 
| AREA=addr / (r) ,GLOBAL=NO / YES ,TIME=NO / YES ,IOCNT=NO / YES / EXT / STD ,MF=S / (E,..) / L | 
At least one of the operands GLOBAL, TIME or IOCNT must be specified with the value YES, otherwise the macro is rejected with:
- X'10' in register R15 if only default values (NO) were specified explicitly. 
- an MNOTE message (in the ASSEMBLER log) if none of the operands GLOBAL, TIME or IOCNT were specified explicitly. 
AREA=
Specifies a field where resource utilization values are entered. The field must be aligned on a word boundary. The length of the field is determined by the desired information package (see “Output structure format”).
addr
Symbolic address of the field.
(r)
Register containing the address value “addr”.
GLOBAL=
Specifies the information package “global values”.
NO
The information package “global values” is not selected.
YES
Resource utilization is output.
IOCNT=
Specifies the information package “input/output count”.
NO
The information package “input/output count” is not selected.
YES
The total number of input/output operations to/from public volumes and system private disks is output.
STD
The total number of input/output operations to/from public volumes and system private disks is output.
EXT
Same as STD or YES, but includes input/output operations to/from tapes, user private disks and other devices.
MF=
For a general description of the MF operand, its operand values and any subsequent operands (e.g. for a prefix), see section “S-type macros”. The valid MF values are given at the start of the macro description under “Macro type” and are included in the macro format.
TIME=
Specifies the information package “time usage”.
NO
The information package “time usage” is not selected.
YES
CPU time and time stamp (time of day) are to be measured. The time stamp in the usage stamp method is the value of the TOD register converted to seconds and nanoseconds.
Format 2: Measurement method
Start or restart measurement
| AINF | 
| READY='measid' / addr / (r) ,GLOBAL=NO / YES ,TIME=NO / YES ,IOCNT=NO / YES / EXT / STD [,CHAIN=addr / (r)] ,MF=S / (E,..) / L | 
At least one of the operands GLOBAL, TIME or IOCNT must be specified with the value YES, otherwise the macro is rejected with:
- X'10' in register R15 if only default values (NO) were specified explicitly. 
- an MNOTE message (in the ASSEMBLER log) if none of the operands GLOBAL, TIME or IOCNT were specified explicitly. 
CHAIN=
Permits the AINF macro to be chained to another AINF macro by specifying a chaining address. This address refers to the data area of the second AINF macro generated with MF=L. See notes on chaining ("AINF - Measure resource utilization").
addr
Address of the operand list of the second macro generated with MF=L.
(r)
Register containing the address value “addr”. This operand is permitted only for the standard form or the L form of the macro.
GLOBAL=
Specifies the information package “global values”.
NO
The information package “global values” is not selected.
YES
Resource utilization is output.
IOCNT=
Specifies the information package “input/output count”.
NO
The information package “input/output count” is not selected.
YES
The total number of input/output operations to/from public volumes and system private disks is output.
STD
The total number of input/output operations to/from public volumes and system private disks is output.
EXT
Same as STD or YES, but includes input/output operations to/from tapes, user private disks and other devices.
MF=
For a general description of the MF operand, its operand values and any subsequent operands (e.g. for a prefix), see section “S-type macros”. The valid MF values are given at the start of the macro description under “Macro type” and are included in the macro format.
READY=
Starts a new measurement and assigns it the specified measurement ID.
'measid'
Measurement ID assigned to the measurement. Length: up to 8 characters.
If the 'measid' name is already assigned to an (interrupted) measurement, this measurement is restarted.
addr
Symbolic name (address) of a field containing the measurement ID.
(r)
Register containing the address value “addr”.
TIME=
Specifies the information package “time usage”.
NO
The information package “time usage” is not selected.
YES
CPU time and runtime are to be output.
Note
When a measurement is restarted, the selection of measurement packages (GLOBAL, TIME, IOCNT) must match the specifications made when the measurement was originally started. If this is not the case, the measurement is continued with the information packages originally specified and the return information X'24' is stored in register R15.
Format 3: Measurement method. Interrupt or terminate measurement
| AINF | 
| {INTR={'measid' / addr / (r)[,AREA=addr / (r)]} / FINISH={'measid' / addr / (r),AREA=addr / (r)}} [,CHAIN=addr / (r)] ,MF=S / (E,..) / L | 
AREA=
Specifies a field where resource utilization values are entered. The field must be aligned on a word boundary. The length of the field is determined by the desired information package (see “Output structure format”).
addr
Symbolic address of the field.
(r)
Register containing the address value “addr”.
CHAIN=
Permits the AINF macro to be chained to another AINF macro by specifying a chaining address. This address refers to the operand list of the second AINF macro generated with MF=L. See notes on chaining ("AINF - Measure resource utilization").
addr
Address of the operand list of the second macro generated with MF=L.
(r)
Register containing the address value “addr”. This operand is permitted only for the standard form or the L form of the macro.
FINISH=
FINISH terminates the measurement with the specified measurement ID.
'measid'
Measurement ID assigned to the measurement.
addr
Symbolic address of a field containing the measurement ID.
(r)
Register containing the address value “addr”.
INTR=
INTR interrupts the measurement with the specified measurement ID.
'measid'
Measurement ID assigned to the measurement.
addr
Symbolic address of a field containing the measurement ID.
(r)
Register containing the address value “addr”.
MF=
For a general description of the MF operand, its operand values and any subsequent operands (e.g. for a prefix), see section “S-type macros”. The valid MF values are given at the start of the macro description under “Macro type” and are included in the macro format.
Format 4: DSECTs for operand list and output structure (at least one operand must be specified)
| AINF | 
| [MF=D] ,P=I / P / * [,GLOBAL=D] [,TIME=D] [,IOCNT=D] | 
GLOBAL=D
Generates a DSECT for the output structure of the information package “global values”.
IOCNT=D
Generates a DSECT for the output structure of the information package “input/output count”.
MF=D
Generates a DSECT for the operand list and EQU statements for the return code.
P=
Specifies a prefix for the symbolic names of the DSECT.
I
The generated field names begin with the prefix I, the length definitions with LIxx.
p
Letter prefixed to all generated field names of the DSECT. The prefix is also included in the names of the length definitions: L&p.xx.
Length of the prefix = 1 letter.
*
No letter is prefixed to the generated field names or included in the names of the length definitions.
TIME=D
Generates a DSECT for the output structure of the information package “time usage”.
AINF MF=D 1 #INTF INTNAME=AINF,REFTYPE=REQUEST,INTCOMP=001 GS 950 1 MFPRE DNAME=AIMPL,MF=D,PREFIX=I,MACID=AIM,DMACID=AIM :*R200 2 IAIMPL DSECT , 2 *,##### PREFIX=I, MACID=AIM ##### 1 DS 0F AINF PARAMETER LIST 1 IAIMID DS CL2 IDENTIFICATION OF AINF MACRO 1 IAIMAINF EQU C’AI’ - AINF INFORMATION STAMP 1 IAIMPMAC EQU C’PM’ - PROG MEASUREMENT FUNCT. 1 IAIMVER DC XL2’075’ AINF MACRO VERSION 1 IAIMFC DS X FUNCTION CODE 1 IAIMFCCV EQU X’01’ - CURRENT USAGE VALUES 1 IAIMFCRE EQU X’02’ - MEASUREMENT READY 1 IAIMFCIN EQU X’04’ - MEASUREMENT INTR 1 IAIMFCFI EQU X’08’ - MEASUREMENT FINISH 1 IAIMNPAR DC FL1’4’ # OF PARAMETERS 1 * + 8 = DIST OF FIRST PARAM ADDR 1 IAIMMSK1 DC X’00’ INFORMATION PACKAGE MASK1 1 IAIMGLOB EQU X’80’ - "GLOBAL" REQUIRED 1 IAIMTIME EQU X’40’ - "TIME" REQUIRED 1 IAIMIOCN EQU X’20’ - "IOCNT=STD" REQUIRED 1 IAIMIOCX EQU X’10’ - "IOCNT=EXT" REQUIRED 1 * EQU X’0F’ - ALL OTHER BITS RESERVED 1 IAIMMSK2 DC X’00’ INFORMATION PACKAGE MASK2 1 * EQU X’FF’ - ALL BITS RESERVED 1 IAIMTARE DS X TYPE OF AREA PARAM 1 IAIMNONE EQU X’00’ - NOT SPECIFIED 1 IAIMADDR EQU X’01’ - GIVEN AS DIRECT ADDRESS 1 IAIMREG EQU X’02’ - GIVEN IN A REGISTER 1 IAIMTCHA DS X TYPE OF CHAIN PARAM 1 * - EQUATES AS ABOVE 1 IAIMTMID DS X TYPE OF MEASUREMENT ID 1 * - EQUATES AS ABOVE, + 1 IAIMSTR EQU X’03’ - GIVEN AS A STRING 1 IAIMTMIX DS X TYPE OF MID CONTINUED 1 IAIMEXT EQU X’FF’ - EXTENDED PARAMETER 1 IAIMAREA DS A OUTPUT AREA ADDRESS 1 IAIMCHAI DS A CHAIN ADDRESS 1 IAIMMID DS 0A MEASUREMENT ID ADDR OR 1 IAIMMIDS DS CL8 MEASUREMENT ID STRING 1 IAIMPLE EQU * END OF AINF PARAM LIST 1 LIAIMPL EQU *-IAIMPL LENGTH OF AINF PARAM LIST 1 SPACE 2
The DSECT is followed by the definitions of possible return codes. This part of the expansion is listed below under “Return information and error flags”.
Output structure format
- Information package Global values 
| Field name | Displacement | Contents | 
| 
 | 
 | CPU time in the following format: | 
| 
 | 
 | Total number of inputs/outputs | 
| 
 | Number of data blocks | |
| 
 | Working set integral | 
AINF GLOBAL=D 1 #INTF INTNAME=AINF,REFTYPE=REQUEST,INTCOMP=001 GS 950 1 MFPRE DNAME=AIAREA,MF=D,PREFIX=I,MACID=AIA,DMACID=AIA :*R200 2 IAIAREA DSECT , 2 *,##### PREFIX=I, MACID=AIA ##### 1 DS 0F START OF OUTPUT AREA 1 MFPRE DNAME=AIGLOB,ALIGN=F,PREFIX=I,MACID=AIG,MF=S, :*R200C 1 DMACID=AIG :*R200 2 CNOP 0,4 2 IAIGLOB DS 0F 1 * "GLOBAL" INFO PACKAGE 1 IAIGTCPU DS 0FL8 CPU TIME 1 IAIGCPUS DS F CPU TIME SECONDS 1 IAIGCPUN DS F CPU TIME NANOSECONDS 1 IAIG#IOS DS F TOTAL # IO’S 1 IAIG#BLK DS F TOTAL # BLOCKS GS 090 1 IAIGWSI DS FL8 WORKING SET INTEGRAL GS 090 1 IAIGLOBE EQU * END OF "GLOBAL" INFO 1 LIAIGLOB EQU *-IAIGLOB LENGTH OF "GLOBAL" INFO 1 SPACE 2 1 * END OF OUTPUT AREA 1 MFPRE DNAME=AIAEND,ALIGN=F,PREFIX=I,MACID=AIA,MF=S, :*R200C 1 DMACID=AIA :*R200 2 CNOP 0,4 2 IAIAEND DS 0F 1 LIAIAREA EQU *-IAIAREA LENGTH OF OUTPUT AREA 1 SPACE 2
The measured CPU time is composed of:
- CPU time in nonprivileged program mode 
- CPU time in privileged program mode (SVC call and program error processing) 
- CPU time during command processing - Information package Time usage 
 - Field name - Displacement - Contents - IAITTCPU- 00- CPU time in the following format: 
 Displacement 00: full seconds
 Displacement 04: remainder in nanoseconds
 Current measurement accuracy: 1 microsecond- IAITETIM- 08- For measurement method: runtime 
 Displacement 08: full seconds
 Displacement 0C: remainder in nanoseconds
 Current measuring accuracy: 1 microsecond- AINF TIME=D 1 #INTF INTNAME=AINF,REFTYPE=REQUEST,INTCOMP=001 GS 950 1 MFPRE DNAME=AIAREA,MF=D,PREFIX=I,MACID=AIA,DMACID=AIA :*R200 2 IAIAREA DSECT , 2 *,##### PREFIX=I, MACID=AIA ##### 1 DS 0F START OF OUTPUT AREA 1 MFPRE DNAME=AITIME,ALIGN=F,PREFIX=I,MACID=AIT,MF=S, :*R200C 1 DMACID=AIT :*R200 2 CNOP 0,4 2 IAITIME DS 0F 1 * "TIME" INFO PACKAGE 1 IAITTCPU DS 0FL8 CPU TIME 1 IAITCPUS DS F CPU TIME SECONDS 1 IAITCPUN DS F CPU TIME NANOSECONDS 1 IAITETIM DS 0FL8 ELAPSED TIME / TIME STAMP 1 IAITTIMS DS F TIME IN SECONDS 1 IAITTIMN DS F TIME NANOSECONDS 1 IAITIMEE EQU * END OF "TIME" INFO 1 LIAITIME EQU *-IAITIME LENGTH OF "TIME" INFO 1 SPACE 2 1 * END OF OUTPUT AREA 1 MFPRE DNAME=AIAEND,ALIGN=F,PREFIX=I,MACID=AIA,MF=S, :*R200C 1 DMACID=AIA :*R200 2 CNOP 0,4 2 IAIAEND DS 0F 1 LIAIAREA EQU *-IAIAREA LENGTH OF OUTPUT AREA 1 SPACE 2 - A breakdown of CPU time is given in the “global values” information package. 
 The time stamp in the usage stamp method is the value of the TOD register converted into seconds and nanoseconds.- Information package Input/output count 
 - Field name - Displacement - Contents - IAII#IOS- 00- Input/output total - IAIIIOPD- 04- Input/output on public volumes - IAIIIOSD- 08- Input/output on shareable private disks - IAIIIOUD- 0C- Input/output on task-exclusive disks - IAIIIOTP- 10- Input/output on tape - IAIIIOUR- 14- Input/output on other devices - AINF IOCNT=D 1 #INTF INTNAME=AINF,REFTYPE=REQUEST,INTCOMP=001 GS 950 1 MFPRE DNAME=AIAREA,MF=D,PREFIX=I,MACID=AIA,DMACID=AIA :*R200 2 IAIAREA DSECT , 2 *,##### PREFIX=I, MACID=AIA ##### 1 DS 0F START OF OUTPUT AREA 1 MFPRE DNAME=AIIOCN,ALIGN=F,PREFIX=I,MACID=AII,MF=S :*R200DMACIC 1 D=AII :*R200 2 CNOP 0,4 2 IAIIOCN DS 0F 1 * "IOCNT" INFO PACKAGE 1 IAII#IOS DS F TOTAL # IO’S 1 IAIIIOPD DS F # IO’S ON PUBLIC DEVICES 1 IAIIIOSD DS F # IO’S ON SYSTEM PRIV. DISKS 1 IAIIIOUD DS F # IO’S ON USER PRIVATE DISKS 1 IAIIIOTP DS F # IO’S ON TAPE DEVICES 1 IAIIIOUR DS F # IO’S ON UNIT RECORD DEVICES 1 IAIIOCNE EQU * END OF "IOCNT" INFO 1 LIAIIOCN EQU *-IAIIOCN LENGTH OF "IOCNT" INFO 1 SPACE 2 1 * END OF OUTPUT AREA 1 MFPRE DNAME=AIAEND,ALIGN=F,PREFIX=I,MACID=AIA,MF=S, C 1 DMACID=AIA 2 CNOP 0,4 2 IAIAEND DS 0F 1 LIAIAREA EQU *-IAIAREA LENGTH OF OUTPUT AREA - The following are not included in the input/output count: - Terminal inputs/outputs for interactive and transaction processes 
- Paging inputs/outputs 
 - The following applies in addition to single inputs/outputs to tapes, user private disks and other devices (see the IOCNT=EXT operand): 
 The following are not included in the input/output count- I/Os from privileged programs 
- I/Os to devices released prior to the program run (by REMOVE-FILE-LINK or SECURE-RESOURCE-ALLOCATION) 
 - As these restrictions do not apply to the input/output totals, the value computed for the total number may be greater than the sum of single values. - Notes on chaining for measurement method (CHAIN operand) - The AINF data area designated by CHAIN is processed immediately after the data area of the calling AINF macro. This allows several AINF calls to be executed within one SVC processing session; e.g. terminating or interrupting a measurement with concurrent start or restart of a new measurement (under a different measurement ID); or interrupting a measurement to output current measuring results with immediate restart of the same measurement. 
- Address transfer in registers facilitates reentrant programming but is not recommended unless no more than two operands are to be linked. 
- Following SVC processing, register R1 contains the address of the most recently processed data area. 
- If an error occurs in the AINF data area of a chain, the chain is terminated at this point. Register R1 then contains the address of the errored data area. 
 - Return information and error flags- Register R1 contains the address of the data area; for macro chaining, it contains the address of the most recently processed data area.. - R15: - +---------------+ | | | | | | | | | | | |a|a| +---------------+ - A return code relating to the execution of the AINF macro is transferred in the rightmost byte of register R15; the remaining three bytes are deleted. - Field name - X'aa' - Meaning - IAIROK - X'00' - Call executed successfully. - IAIRADER - X'04' - Call not executed due to invalid operand list address. - IAIRFUER - X'08' - Call not executed due to invalid macro ID or invalid function code (neither 
 usage stamp method nor READY, INTR or FINISH).- IAIRCHER - X'0C' - Call executed despite invalid chaining address in most recently processed 
 operand block (READY, INTR, FINISH).- IAIRPAER - X'10' - Call not executed due to: - invalid register or output area address; 
- invalid register or measurement ID address; 
- missing operand entries. 
 - IAIRMRDY - X'14' - Call not executed because measurement is already being performed under 
 the specified measurement ID (with READY).- IAIRNCL5 - X'18' - Call not executed because there is no more class 5 memory available for 
 work area (with READY).- IAIRMNTF - X'1C' - Call not executed because INTR or FINISH had no associated READY; i.e. 
 measurement not yet started.- IAIRMINT - X'20' - Call executed despite FINISH for a measurement interrupted by means of 
 INTR; i.e. measurement not yet resumed.- IAIRIRIN - X'24' - Call executed despite fact that READY call for measurement resumption 
 (after INTR) does not contain same information as READY call when
 measurement was started.- During macro chaining, the specification “Call executed / not executed?” refers to the most recently processed data area (i.e. the data area whose address is stored in register R1). If an error occurs during chaining, the chain is terminated at the point of the errored data area, where: - “executed” - indicates that the last (errored) data area was still processed. If the error 
 can be corrected by the user program, continuation of processing
 starting at the next data area should be requested.- “not executed” - indicates that the last (errored) data area could not be processed. If the 
 error can be corrected by the user program, processing should continue
 with the same (corrected) operand list.
Example 1: Usage stamp method
AINF1    START
         PRINT NOGEN
         BALR  3,0
         USING *,3
         LA    5,AREAONE
         USING AINFDATA,5
         AINF  GLOBAL=Y,TIME=Y,IOCNT=EXT,AREA=AREAONE ———————————————  (1) 
         PRINT NOGEN
*
*        Display CPU time
*
         MVC   MESSTXT(L'MCPU),MCPU
         L     8,IAIGCPUS              CPU time in seconds
         BAL   7,PKD2ZND               Call conversion routine ------>
         MVC   MESSTXT+20(10),ASSIST2+6
         MVI   MESSTXT+30,C'.'
         L     8,IAIGCPUN              CPU time in nanoseconds
         BAL   7,PKD2ZND               Call conversion routine ------>
         MVC   MESSTXT+31(9),ASSIST2+7
         BAL   7,OUTPUT                Call output routine ---------->
*
*        Display elapsed time
*
         MVC   MESSTXT(L'MELA),MELA
         L     8,IAITTIMS              Elapsed time in seconds
         BAL   7,PKD2ZND               Call conversion routine ------>
         MVC   MESSTXT+20(10),ASSIST2+6
         MVI   MESSTXT+30,C'.'
         L     8,IAITTIMN              Elapsed time in nanoseconds
         BAL   7,PKD2ZND               Call conversion routine ------>
         MVC   MESSTXT+31(9),ASSIST2+7
         BAL   7,OUTPUT                Call output routine ---------->
*
*        Display # IO's
*
         MVC   MESSTXT(L'MIOS),MIOS    * Total # IO's ****************
         L     8,IAII#IOS
         BAL   7,PKD2ZND               Call conversion routine ------>
         MVC   MESSTXT+30(10),ASSIST2+6
         BAL   7,OUTPUT                Call output routine ---------->
*
         MVC   MESSTXT(L'MIOP),MIOP    * Public IO's *****************
         L     8,IAIIIOPD
         BAL   7,PKD2ZND               Call conversion routine ------>
         MVC   MESSTXT+30(10),ASSIST2+6
         BAL   7,OUTPUT                Call output routine ---------->
  *
           MVC   MESSTXT(L'MIOSP),MIOSP  * System private IO's *********
           L     8,IAIIIOSD
           BAL   7,PKD2ZND               Call conversion routine ------>
           MVC   MESSTXT+30(10),ASSIST2+6
           BAL   7,OUTPUT                Call output routine ---------->
  *
           MVC   MESSTXT(L'MIOSP),MIOSP  * User private IO's ***********
           L     8,IAIIIOUD
           BAL   7,PKD2ZND               Call conversion routine ------>
           MVC   MESSTXT+30(10),ASSIST2+6
           BAL   7,OUTPUT                Call output routine ---------->
  *
           MVC   MESSTXT(L'MITP),MITP    * Tape devices ****************
           L     8,IAIIIOTP
           BAL   7,PKD2ZND               Call conversion routine ------>
           MVC   MESSTXT+30(10),ASSIST2+6
           BAL   7,OUTPUT                Call output routine ---------->
  *
           MVC   MESSTXT(L'MIUR),MIUR    * Unit record devices *********
           L     8,IAIIIOUR
           BAL   7,PKD2ZND               Call conversion routine ------>
           MVC   MESSTXT+30(10),ASSIST2+6
           BAL   7,OUTPUT                Call output routine ---------->
  END      TERM
  *
  *        Output routine
  *
  OUTPUT   WROUT MESSAGE,END,PARMOD=31
2                *,@DCEO      999    921011   53531004
           MVI   MESSTXT,C' '            Clear MESSTXT for next output
           MVC   MESSTXT+1(L'MESSTXT-1),MESSTXT
           BR    7                       Return ->
  *
  *        Conversion routine
  *
  PKD2ZND  CVD   8,ASSIST1               Convert register contents to
           UNPK  ASSIST2,ASSIST1         zoned decimal
           MVZ   ASSIST2+15(1),=X'F0'
           BR    7                       Return ->
  *
  *        Definitions
  *
  AREAONE  DS    0F
           DS    6F
           DS    4F
           DS    6F
  MESSAGE  DC    Y(ENDMESS-MESSAGE)      Record length
           DS    CL2                     Reserved
           DC    X'01'                   Print feed control character
  MESSTXT  DC    CL60' '                 Text
  ENDMESS  EQU   *
  ASSIST1  DS    D
  ASSIST2  DS    CL16
  MCPU     DC    C'CPU Time used:'
  MELA     DC    C'Elapsed Time used:'
  MIOS     DC    C'Total number of IOs:'
  MIOP     DC    C'IOs on public devices:'
  MIOSP    DC    C'IOs on system private disks:'
  MIOUP    DC    C'IOs on user private disks:'
  MITP     DC    C'IOs on tape devices:'
  MIUR     DC    C'IOs on unit record devices:'
           PRINT GEN
  AINFDATA AINF  GLOBAL=D,TIME=D,IOCNT=D ——————————————————————————————  (2) 
1          #INTF INTNAME=AINF,REFTYPE=REQUEST,INTCOMP=001          GS 950
1 AINFDATA MFPRE DNAME=AIAREA,MF=D,PREFIX=I,MACID=AIA,DMACID=AIA   :*R200
2 AINFDATA DSECT ,
2                *,##### PREFIX=I, MACID=AIA #####
1 IAIAREA  DS    0F                      START OF OUTPUT AREA      LKH075
1          MFPRE DNAME=AIGLOB,ALIGN=F,PREFIX=I,MACID=AIG,MF=S,     :*R200C
1                DMACID=AIG                                        :*R200
2          CNOP  0,4
2 IAIGLOB  DS    0F
1 *                                      "GLOBAL" INFO PACKAGE     LKH075
1 IAIGTCPU DS    0FL8                    CPU TIME                  LKH075
1 IAIGCPUS DS    F                       CPU TIME SECONDS          LKH075
1 IAIGCPUN DS    F                       CPU TIME NANOSECONDS      LKH075
1 IAIG#IOS DS    F                       TOTAL # IO'S              LKH075
1 IAIG#BLK DS    F                       TOTAL # BLOCKS            GS 090
1 IAIGWSI  DS    FL8                     WORKING SET INTEGRAL      GS 090
1 IAIGLOBE EQU   *                       END OF "GLOBAL" INFO      LKH075
1 LIAIGLOB EQU   *-IAIGLOB              LENGTH OF "GLOBAL" INFO   LKH075
1          SPACE 2                                                 LKH075
1          MFPRE DNAME=AITIME,ALIGN=F,PREFIX=I,MACID=AIT,MF=S,     :*R200C
1                DMACID=AIT                                        :*R200
2          CNOP  0,4
2 IAITIME  DS    0F
1 *                                      "TIME"   INFO PACKAGE     LKH075
1 IAITTCPU DS    0FL8                    CPU TIME                  LKH075
1 IAITCPUS DS    F                       CPU TIME SECONDS          LKH075
1 IAITCPUN DS    F                       CPU TIME NANOSECONDS      LKH075
1 IAITETIM DS    0FL8                    ELAPSED TIME / TIME STAMP LKH075
1 IAITTIMS DS    F                       TIME IN SECONDS           LKH075
1 IAITTIMN DS    F                       TIME NANOSECONDS          LKH075
1 IAITIMEE EQU   *                       END OF "TIME"   INFO      LKH075
1 LIAITIME EQU   *-IAITIME              LENGTH OF "TIME"   INFO   LKH075
1          SPACE 2                                                 LKH075
1          MFPRE DNAME=AIIOCN,ALIGN=F,PREFIX=I,MACID=AII,MF=S :*R200DMACIC
1                D=AII                                        :*R200
2          CNOP  0,4
2 IAIIOCN  DS    0F
1 *                                      "IOCNT"  INFO PACKAGE     LKH075
1 IAII#IOS DS    F                       TOTAL # IO'S              LKH075
1 IAIIIOPD DS    F                # IO'S ON PUBLIC DEVICES         LKH075
1 IAIIIOSD DS    F                # IO'S ON SYSTEM PRIV. DISKS     LKH075
1 IAIIIOUD DS    F                # IO'S ON USER PRIVATE DISKS     LKH075
1 IAIIIOTP DS    F                # IO'S ON TAPE DEVICES           LKH075
1 IAIIIOUR DS    F                # IO'S ON UNIT RECORD DEVICES    LKH075
1 IAIIOCNE EQU   *                       END OF "IOCNT"  INFO      LKH075
1 LIAIIOCN EQU   *-IAIIOCN              LENGTH OF "IOCNT"  INFO   LKH075
1          SPACE 2                                                 LKH075
1 *                                      END OF OUTPUT AREA        LKH075
1          MFPRE DNAME=AIAEND,ALIGN=F,PREFIX=I,MACID=AIA,MF=S,     :*R200C
1                DMACID=AIA                                        :*R200
2          CNOP  0,4
2 IAIAEND  DS    0F
1 LIAIAREA EQU   *-IAIAREA              LENGTH OF OUTPUT AREA     LKH075
1          SPACE 2                                                 LKH075
           END
                 =X'F0'
| (1) | Resource utilization since the start of the job is to be measured using the information packages “global values”, “time usage” and “input/output count”. The measurement values are to be transferred to the area  | 
| (2) | A DSECT is generated for each of the different information packages. The field names defined there may be used for symbolic addressing of the measurement values in  | 
Runtime log
/start-assembh % BLS0500 PROGRAM 'ASSEMBH', VERSION '<ver>' OF '<date>' LOADED % ASS6010 <ver> OF BS2000 ASSEMBH READY //compile source=*library-element(macexmp.lib,ainf1), - // compiler-action=module-generation(module-format=llm), - // module-library=macexmp.lib, - // listing=parameters(output=*library-element(macexmp.lib,ainf1)) % ASS6011 ASSEMBLY TIME: 380 MSEC % ASS6018 0 FLAGS, 0 PRIVILEGED FLAGS, 0 MNOTES % ASS6019 HIGHEST ERROR-WEIGHT: NO ERRORS % ASS6006 LISTING GENERATOR TIME: 107 MSEC //end % ASS6012 END OF ASSEMBH /start-executable-program library=macexmp.lib,element-or-symbol=ainf1 % BLS0523 ELEMENT 'AINF1', VERSION '@' FROM LIBRARY ':2OSG:$QM212.MACEXMP.LIB' IN PROCESS % BLS0524 LLM 'AINF1', VERSION ' ' OF '<date> <time>' LOADED CPU Time used: 0000000058.526666000 —————————————————————————————— (3) Elapsed Time used: 0000001333.942669000 Total number of IOs: 0000019462 IOs on public devices: 0000019462 IOs on system private disks: 0000000000 IOs on system private disks: 0000000000 IOs on tape devices: 0000000000 IOs on unit record devices: 0000000000
| (3) | The calculated measurement values are output. | 
Example 2: Measurement method
In the AINF2 program, two measurements are started. These measurements are assigned the codes MES 1 and MES 2.
MES1 requests resource utilisation data which corresponds to the information packages “time usage” and “input and output tally”. When the measurement is terminated, the information should be output to AREA1.
MES2 requests resource utilisation data which corresponds to the information packages “global values” and “input and output tally”. When the measurement is suspended, i.e. at the end of the first measurement period, the information should be output to AREA2A; when the measurement is terminated, to AREA2B.
In addition, the DSECTS for the output structures of the information packages are generated for MES1 and MES2 and are linked to the relevant output areas.
AINF2    START
         PRINT NOGEN
         BALR  3,0
         USING *,3
MES1B    AINF  READY='MES1',TIME=Y,IOCNT=EXT    Start MES1
         LTR   15,15                   If Returncode not zero
         BNE   ERROR                   go to ERROR ->
         MVC   MESSTXT,STARTMSG
         BAL   7,OUTPUT                Call output routine ---------->
MES2B    AINF  READY='MES2',GLOBAL=Y,IOCNT=Y             Start MES2
         LTR   15,15                   If Returncode not zero
         BNE   ERROR                   go to ERROR ->
         MVI   STARTMSG+3,C'2'         Modify start message
         MVC   MESSTXT,STARTMSG
         BAL   7,OUTPUT                Call output routine ---------->
MES2I    AINF  INTR='MES2',AREA=AREA2A                   Interrupt MES2
MES2C    AINF  READY='MES2',GLOBAL=Y,IOCNT=Y             Continue MES2
         BKPT
MES2E    AINF  FINISH='MES2',AREA=AREA2B                 Terminate MES2
MES1E    AINF  FINISH='MES1',AREA=AREA1         Terminate MES1
*
*        Display Elapsed Time (MES1)
*
         USING MES1PAR,5
         LA    5,AREA1
         MVC   MESSTXT(L'MELA),MELA
         L     8,AAITTIMS              Elapsed time in seconds
         BAL   7,PKD2ZND               Call conversion routine ------>
         MVC   MESSTXT+20(10),ASSIST2+6
         MVI   MESSTXT+30,C'.'
         L     8,AAITTIMN              Elapsed time in nanoseconds
         BAL   7,PKD2ZND               Call conversion routine
         MVC   MESSTXT+31(9),ASSIST2+7
           BAL   7,OUTPUT                Call output routine ---------->
  *
  *        Display # IO's at interrupt (MES2)
  *
           USING MES2PAR,6
           LA    6,AREA2A
           MVC   MESSTXT(L'MIOPI),MIOPI  * Public IO's *****************
           L     8,BAIIIOPD
           BAL   7,PKD2ZND               Call conversion routine ------>
           MVC   MESSTXT+30(10),ASSIST2+6
           BAL   7,OUTPUT                Call output routine ---------->
  *
  *        Display # IO's at end (MES2)
  *
           LA    6,AREA2B
           MVC   MESSTXT(L'MIOPE),MIOPE  * Public IO's *****************
           L     8,BAIIIOPD
           BAL   7,PKD2ZND               Call conversion routine ------>
           MVC   MESSTXT+30(10),ASSIST2+6
           BAL   7,OUTPUT                Call output routine ---------->
  END      TERM
  ERROR    NOP   ERROR
  *        :                Error handling
           TERM
  *
  *        Output routine
  *
  OUTPUT   WROUT MESSAGE,END,PARMOD=31
2                *,@DCEO      999    921011   53531004
           MVI   MESSTXT,C' '            Clear MESSTXT for next output
           MVC   MESSTXT+1(L'MESSTXT-1),MESSTXT
           BR    7                       Return ->
  *
  *        Conversion routine
  *
  PKD2ZND  CVD   8,ASSIST1               Convert register contents to
           UNPK  ASSIST2,ASSIST1         zoned decimal
           MVZ   ASSIST2+15(1),=X'F0'
           BR    7                       Return ->
  AREA1    DS    10F
  AREA2A   DS    12F
  AREA2B   DS    12F
  MESSAGE  DC    Y(ENDMESS-MESSAGE)      Record length
           DS    CL2                     Reserved
           DC    X'01'                   Print feed control character
  MESSTXT  DC    CL60' '                 Text
  ENDMESS  EQU   *
  STARTMSG DC    CL60'MES1 successfully started'
  ASSIST1  DS    D
  ASSIST2  DS    CL16
  MCPU     DC    C'CPU Time used:'
  MELA     DC    C'Elapsed Time used:'
  MIOPI    DC    C'IOs before BKPT:'
  MIOPE    DC    C'IOs after BKPT:'
           PRINT GEN
  MES1PAR  AINF  TIME=D,IOCNT=D,P=A
1          #INTF INTNAME=AINF,REFTYPE=REQUEST,INTCOMP=001          GS 950
1 MES1PAR  MFPRE DNAME=AIAREA,MF=D,PREFIX=A,MACID=AIA,DMACID=AIA   :*R200
2 MES1PAR  DSECT ,
2                *,##### PREFIX=A, MACID=AIA #####
1 AAIAREA  DS    0F                      START OF OUTPUT AREA      LKH075
1          MFPRE DNAME=AITIME,ALIGN=F,PREFIX=A,MACID=AIT,MF=S,     :*R200C
1                DMACID=AIT                                        :*R200
2          CNOP  0,4
2 AAITIME  DS    0F
1 *                                      "TIME"   INFO PACKAGE     LKH075
1 AAITTCPU DS    0FL8                    CPU TIME                  LKH075
1 AAITCPUS DS    F                       CPU TIME SECONDS          LKH075
1 AAITCPUN DS    F                       CPU TIME NANOSECONDS      LKH075
1 AAITETIM DS    0FL8                    ELAPSED TIME / TIME STAMP LKH075
1 AAITTIMS DS    F                       TIME IN SECONDS           LKH075
1 AAITTIMN DS    F                       TIME NANOSECONDS          LKH075
1 AAITIMEE EQU   *                       END OF "TIME"   INFO      LKH075
1 LAAITIME EQU   *-AAITIME              LENGTH OF "TIME"   INFO   LKH075
1          SPACE 2                                                 LKH075
1          MFPRE DNAME=AIIOCN,ALIGN=F,PREFIX=A,MACID=AII,MF=S :*R200DMACIC
1                D=AII                                        :*R200
2          CNOP  0,4
2 AAIIOCN  DS    0F
1 *                                      "IOCNT"  INFO PACKAGE     LKH075
1 AAII#IOS DS    F                       TOTAL # IO'S              LKH075
1 AAIIIOPD DS    F                # IO'S ON PUBLIC DEVICES         LKH075
1 AAIIIOSD DS    F                # IO'S ON SYSTEM PRIV. DISKS     LKH075
1 AAIIIOUD DS    F                # IO'S ON USER PRIVATE DISKS     LKH075
1 AAIIIOTP DS    F                # IO'S ON TAPE DEVICES           LKH075
1 AAIIIOUR DS    F                # IO'S ON UNIT RECORD DEVICES    LKH075
1 AAIIOCNE EQU   *                       END OF "IOCNT"  INFO      LKH075
1 LAAIIOCN EQU   *-AAIIOCN              LENGTH OF "IOCNT"  INFO   LKH075
1          SPACE 2                                                 LKH075
1 *                                      END OF OUTPUT AREA        LKH075
1          MFPRE DNAME=AIAEND,ALIGN=F,PREFIX=A,MACID=AIA,MF=S,     :*R200C
1                DMACID=AIA                                        :*R200
2          CNOP  0,4
2 AAIAEND  DS    0F
1 LAAIAREA EQU   *-AAIAREA              LENGTH OF OUTPUT AREA     LKH075
1          SPACE 2                                                 LKH075
  MES2PAR  AINF  GLOBAL=D,IOCNT=D,P=B
1          #INTF INTNAME=AINF,REFTYPE=REQUEST,INTCOMP=001          GS 950
1 MES2PAR  MFPRE DNAME=AIAREA,MF=D,PREFIX=B,MACID=AIA,DMACID=AIA   :*R200
2 MES2PAR  DSECT ,
2                *,##### PREFIX=B, MACID=AIA #####
1 BAIAREA  DS    0F                      START OF OUTPUT AREA      LKH075
1          MFPRE DNAME=AIGLOB,ALIGN=F,PREFIX=B,MACID=AIG,MF=S,     :*R200C
1                DMACID=AIG                                        :*R200
2          CNOP  0,4
2 BAIGLOB  DS    0F
1 *                                      "GLOBAL" INFO PACKAGE     LKH075
1 BAIGTCPU DS    0FL8                    CPU TIME                  LKH075
1 BAIGCPUS DS    F                       CPU TIME SECONDS          LKH075
1 BAIGCPUN DS    F                       CPU TIME NANOSECONDS      LKH075
1 BAIG#IOS DS    F                       TOTAL # IO'S              LKH075
1 BAIG#BLK DS    F                       TOTAL # BLOCKS            GS 090
1 BAIGWSI  DS    FL8                     WORKING SET INTEGRAL      GS 090
1 BAIGLOBE EQU   *                       END OF "GLOBAL" INFO      LKH075
1 LBAIGLOB EQU   *-BAIGLOB              LENGTH OF "GLOBAL" INFO   LKH075
1          SPACE 2                                                 LKH075
1          MFPRE DNAME=AIIOCN,ALIGN=F,PREFIX=B,MACID=AII,MF=S :*R200DMACIC
1                D=AII                                        :*R200
2          CNOP  0,4
2 BAIIOCN  DS    0F
1 *                                      "IOCNT"  INFO PACKAGE     LKH075
1 BAII#IOS DS    F                       TOTAL # IO'S              LKH075
1 BAIIIOPD DS    F                # IO'S ON PUBLIC DEVICES         LKH075
1 BAIIIOSD DS    F                # IO'S ON SYSTEM PRIV. DISKS     LKH075
1 BAIIIOUD DS    F                # IO'S ON USER PRIVATE DISKS     LKH075
1 BAIIIOTP DS    F                # IO'S ON TAPE DEVICES           LKH075
1 BAIIIOUR DS    F                # IO'S ON UNIT RECORD DEVICES    LKH075
1 BAIIOCNE EQU   *                       END OF "IOCNT"  INFO      LKH075
1 LBAIIOCN EQU   *-BAIIOCN              LENGTH OF "IOCNT"  INFO   LKH075
1          SPACE 2                                                 LKH075
1 *                                      END OF OUTPUT AREA        LKH075
1          MFPRE DNAME=AIAEND,ALIGN=F,PREFIX=B,MACID=AIA,MF=S,     :*R200C
1                DMACID=AIA                                        :*R200
2          CNOP  0,4
2 BAIAEND  DS    0F
1 LBAIAREA EQU   *-BAIAREA              LENGTH OF OUTPUT AREA     LKH075
1          SPACE 2                                                 LKH075
           END
                 =X'F0'
Runtime log
/start-assembh % BLS0500 PROGRAM 'ASSEMBH', VERSION '<ver>' OF '<date>' LOADED % ASS6010 <ver> OF BS2000 ASSEMBH READY //compile source=*library-element(macexmp.lib,ainf2), - // compiler-action=module-generation(module-format=llm), - // module-library=macexmp.lib, - // listing=parameters(output=*library-element(macexmp.lib,ainf2)) % ASS6011 ASSEMBLY TIME: 407 MSEC % ASS6018 0 FLAGS, 0 PRIVILEGED FLAGS, 0 MNOTES % ASS6019 HIGHEST ERROR-WEIGHT: NO ERRORS % ASS6006 LISTING GENERATOR TIME: 106 MSEC //end % ASS6012 END OF ASSEMBH /start-executable-program library=macexmp.lib,element-or-symbol=ainf2 % BLS0523 ELEMENT 'AINF2', VERSION '@' FROM LIBRARY ':2OSG:$QM212.MACEXMP.LIB' IN PROCESS % BLS0524 LLM 'AINF2', VERSION ' ' OF '<date> <time>' LOADED MES1 successfully started ————————————————————————————————————————————— (1) MES2 successfully started ————————————————————————————————————————————— (2) % IDA0199 PROGRAM BREAK AT ADDRESS X'0000B8', AMODE=24———————————————— (3) /copy-file from-file=oldexp,to-file=newexp ———————————————————————————— (4) /resume-program Elapsed Time used: 0000000000.247344000 —————————————————————————————— (5) IOs before BKPT: 0000000000 IOs after BKPT: 0000000011
| (1) | MES1 was started; the macro executed without error. | 
| (2) | MES2 was started; the macro executed without error. | 
| (3) | Program execution was interrupted with BKPT. Previously, MES2 was interrupted in order to save in  | 
| (4) | In the demonstration, a COPY-FILE command is issued (input/output). Program execution is then resumed. MES2 and MES1 are terminated.  | 
| (5) | For demonstration purposes, some of the values determined are displayed: 
 | 
