General
Application areas: | Requesting and accessing lists and tables; see "Requesting and accessing lists and tables"Communication; see "Communication (programs, users, system)" |
Macro type: | Type O; see "O-type macros" |
See the DTMODE macro for a description of the output fields. The symbolic field names used when the 24-bit interface is generated start with the prefix TSK instead of TMOD.
Macro description
The TMODE macro provides the user program with information about the job under which it is running. The user program supplies an area in which this information is to be stored.The macro format depends on the interface desired.
Note
The user ID under which the user program is running can also be interrogated with the RDUID macro. The privilege of the job under which the user program is running can also be interrogated with the CHKPRV macro.
Macro formats and descriptions of operands
Format 1: 24-bit interface call
[name] TMODE |
[ {area[,length] / D}] [,PARMOD=24 / 31] |
name
Name of the DSECT if operand D is specified.
Default value: name = TSKINF0.
area
Name of an area in which the job information is to be stored. “D” must not be used as the name.
length
Specifies the size in bytes of “area”. If the length operand is omitted, the length attribute of “area” is used. If, in either case, the length is less than the number of bytes of information supplied, the data is truncated by the difference.
The length of the information supplied is available as symbolic constant L@TSKINF (EQU value).
D
A dummy section (DSECT) is generated for the output list.
PARMOD=
Controls macro expansion. If PARMOD is not specified here, macro expansion is performed according to the specification for the GPARMOD macro or according to the default setting for the assembler (= 24-bit interface).
24
The 24-bit interface is generated. Data lists and instructions use 24-bit addresses (address space <= 16 Mb).
no entry
The operand values may also be supplied in an operand list, the address of which is contained in register R1.
The operand list has the following format:
Byte | Operand |
0 | Must be set to X' 00'; this is important, since it is the only way of guaranteeing successful |
1 - 3 | Address of the area in which job information is to be stored. |
4 - 5 | Length of the area (here the symbolic constant L@TSKINF may be specified). |
Format 2: 31-bit interface call
TMODE |
[PARMOD=31] [,PARLIST=addr / (r)] |
PARMOD=
Controls macro expansion.
If PARMOD is not specified here, macro expansion is performed according to the specification for the GPARMOD macro or according to the default setting for the assembler (= 24-bit interface).
31
The 31-bit interface is generated. Data lists and instructions use 31-bit addresses (address space <= 2 Gb). Data lists start with the standard header.
PARLIST=
Gives the address of an area where the job data is to be stored. The area should be aligned on a word boundary and must start with the standard header.
The DTMODE macro generates a description (DSECT/data section) for the I/O area; the initialization values for the standard header are entered.
addr
Symbolic address (name) of the area.
(r)
Register containing the address value “addr”.
Return information and error flags
R15:
+---------------+ | | | | | |0|0|a|a|a|a|a|a| +---------------+
A return code relating to the execution of the TMODE macro is transferred in register R15.
X'aaaaaa' | Meaning |
X'000000' | Function has been executed. |
X'000004' | Operand error. |
X'00000C' | System error. |
X'01FFFF' | Incorrect specification for UNIT/FUNCTION in the standard header. |
X'03FFFF' | Incorrect specification for VERSION in the standard header. |
Example
A number of job attributes (type of data display terminal, size of terminal buffer, TSN of the job, user ID, ...) are to be interrogated. The macro is executed in 31-bit addressing mode. The output area is generated by means of the DTMODE macro (with the standard header being initialized). Output fields are edited as required for output by means of the WROUT macro.
TMODE START PRINT NOGEN TMODE AMODE ANY BALR 3,0 USING *,3 TMODE PARMOD=31,PARLIST=TMODPL ————————————————————————————— (1) UNPK HFIELD(3),TMODTYPE(2) MVC TASKT+2(2),HFIELD TR TASKT+2(2),CODTAB UNPK HFIELD(5),TMODBUFS(3) MVC TASKB+2(4),HFIELD TR TASKB+2(4),CODTAB UNPK HFIELD(3),TMODPRI(2) MVC TASKP+2(2),HFIELD TR TASKP+2(2),CODTAB MVC TSN,TMODTSN MVC USERID,TMODUSER MVC ACC,TMODACCT MVC JOB,TMODNAME WROUT AUSB,TERM,MODE=LINE,PARMOD=31 ———————————————————————— (2) 2 *,@DCEO 999 921011 53531004 TERM TERM DS 0F AUSB DC Y(AUSBE-AUSB) DS CL3 DC X'15' DC C'TERMINAL TYPE: ' TASKT DC C'X''00''' DC X'15' DC C'BUFFER TERMINAL: ' TASKB DC C'X''0000''' DC X'15' DC C'RUN PRIORITY: ' TASKP DC C'X''00''' DC X'15' DC C'TSN: ' TSN DS CL4
DC X'15' DC C'USER ID: ' USERID DS CL8 DC X'15' DC C'ACCOUNT NUMBER: ' ACC DS CL8 DC X'15' DC C'JOB NAME: ' JOB DS CL8 DC X'15' AUSBE EQU * HFIELD DS CL5 CODTAB DS CL240 DC C'0123456789' DC C'ABCDEF' DS 0F DTMODE DSECT=NO ———————————————————————————————————————————— (3) END
Runtime log:
/start-assembh % BLS0500 PROGRAM 'ASSEMBH', VERSION '<ver>' OF '<date>' LOADED % ASS6010 <ver> OF BS2000 ASSEMBH READY //compile source=*library-element(macexmp.lib,tmode), - // compiler-action=module-generation(module-format=llm), - // module-library=macexmp.lib, - // listing=parameters(output=*library-element(macexmp.lib,tmode)) % ASS6011 ASSEMBLY TIME: 336 MSEC % ASS6018 0 FLAGS, 0 PRIVILEGED FLAGS, 0 MNOTES % ASS6019 HIGHEST ERROR-WEIGHT: NO ERRORS % ASS6006 LISTING GENERATOR TIME: 86 MSEC //end % ASS6012 END OF ASSEMBH /start-executable-program library=macexmp.lib,element-or-symbol=tmode % BLS0523 ELEMENT 'TMODE', VERSION '@' FROM LIBRARY ':2OSG:$QM212.MACEXMP.LIB' IN PROCESS % BLS0524 LLM 'TMODE', VERSION ' ' OF '<date> <time>' LOADED TERMINAL TYPE: X'35' —————————————————————————————————————————————————— (4) BUFFER TERMINAL: X'07F8' RUN PRIORITY: X'D2' TSN: 2QSE USER ID: QM212 ACCOUNT NUMBER: 89002 JOB NAME: MACTEST
(1) | The TMODE macro is called. The 31-bit interface is generated; the output area is generated by means of the DTMODE macro. | ||
(2) | The interrogated values are output in LINE mode by means of WROUT. Some values had to be edited before output (unpacked and converted into printable characters). | ||
(3) | The output area is generated by means of the DTMODE macro. The standard header is initialized. | ||
(4) | Output in LINE mode:
|