The CLIEXPR macro evaluates arithmetic, logical and string expressions. The expression is passed in an input field, the result is returned in an output field. It is possible to request a specific output format for the result (binary number, Boolean constant, string).
The macro can also be called using MF = M. Refer to the manual “Executive Macros” [7] for further details concerning the operand MF =... .
Operation | Operands |
CLIEXPR | MF = E |
MF = D [,PREFIX = C / prefix ] | |
MF = C ,PREFIX = C / prefix [,MACID = LIE / macid] | |
MF = L ,INPUT@ = <pointer> ,INPUTL = <integer 0..2147483647> ,OUTPUT@ = <pointer> ,OUTPUTL = <integer 0..2147483647> ,VFORM = *BY-VALUE / *STRING ,OTYPE = <pointer> ,OACTL = <pointer> ,PROT@ = NULL / <pointer> ,PROTL = 0 / <integer 0..2147483647> ,OPROTL = NULL / <pointer> |
Operands
<pointer> as used in the description always stands for an address specification of the format A(symbolic address) or for a register containing the address. Specification of a register is possible only with MF = M.
MF = E
Execute format of the macro call; generates an SVC.
PARAM
Specifies the address of the operand list to be evaluated for the macro call (macro call with MF = L).
= <name 1..27>
Specifies the symbolic address of the operand list.
= (<integer 1..15>)
Specifies the register which contains the address of the operand list.
MF = D
DSECT format of the macro call; generates a DSECT for the operand list. Each field has its own name plus additional equates where explanations are required.
PREFIX = C / prefix
Defines the first character of the field names; default = C.
MF = C
C format of the macro call; generates the data area (operand list) only. Each field has its own name plus additional equates where explanations are required. The standard header must be initialized by the user.
PREFIX = C / prefix
Defines the first character of the field names; default = C.
MACID = LIE / macid
Defines the second, third and fourth character of the field names; default = LIE.
MF = L
List format of the macro call; generates the data area (operand list) only, taking operand values specified in the macro call into account. The data area contains no field names and no additional equates. The standard header is initialized.
INPUT@ = <pointer>
Address of the field containing the expression to be evaluated. The expression must be specified as a string expression. The field must be word-aligned.
INPUTL = <integer 0..2147483647>
Length of the field containing the expression to be evaluated.
OUTPUT@ = <pointer>
Address of the field to which the evaluation result is to be written. The field must be word-aligned.
OUTPUTL = <integer 0..2147483647>
Length of the result field. The actual length of the result is entered in the field specified with OACTL=... .
VFORM =
Defines the output format of the result (binary number, Boolean constant or string).
VFORM = *BY-VALUE
Integers are output as binary numbers (4-byte digits).
Boolean constants are output as X’00’ (for FALSE) or X’01’ (for TRUE).
VFORM = *STRING
Integers are output as a string of decimal digits.
Boolean constants are output as either of the strings ’FALSE’ or ’TRUE’.
PROT@ = NULL / <pointer>
Address of the field to which SDF-P messages are to be written. If there are more than one messages, they are written to the field consecutively. Each entry starts with a 2-byte length field, followed by 2 bytes of fill characters and the message text. Default: output to SYSOUT.
Notes
Only messages of message class SDP are entered here, all other messages are output to SYSOUT.
The message format (language, short or long form, etc.) depends on the settings made with the /MODIFY-MSG-ATTRIBUTES command.
PROTL = 0 / <integer 0..2147483647>
Length of the message field. If the length of the output exceeds the specified field length, messages are not truncated; the last message is not written to the field instead. Default: no message entered.
The actual length required for message output is entered in the field specified with OPROTL=... .
OACTL = <pointer>
Address of the field to which the actual length of the result is written. The field must have a length of 4 bytes and must be word-aligned.
OTYPE = <pointer>
Address of the field to which the type of the result is written. The field must have a length of 1 byte. Entries start with the character defined with PREFIX=.. and MACID=.. . Meaning of the entries:
Entry | Meaning (type) |
<prefix, macid>VSTR | String |
<prefix, macid>VINT | Integer |
<prefix, macid>VBOO | Boolean constant |
OPROTL = NULL / <pointer>
Address of the field to which the actual message length is written. The field must have a length of 4 bytes. Default: no entry.
Notes
Only simple values (base terms) are output as results; no complex expressions are returned.
The expression to be evaluated must not contain any & replacements.
The field specified with OTYPE=.. always contains the result type, even if VFORM=*STRING was specified. This enables the user to distinguish a string of digits from an integer, or the string “FALSE” from the Boolean constant FALSE.
Return codes
The table below lists the return codes in hexadecimal format.
Subcode2 | Subcode1 | Maincode | Meaning |
00 | 00 | 0000 | Normal execution |
01 | 00 | 0000 | Overflow of PROT field (Warning) |
00 | 40 | 0001 | Syntax error in expression to be evaluated |
01 | 40 | 0001 | Overflow of PROT field |
00 | 40 | 0002 | Error during evaluation |
01 | 40 | 0002 | Overflow of PROT field |
00 | 40 | 0003 | Output field too short |
00 | 01 | 0004 | Input field not specified or not aligned |
01 | 01 | 0004 | Output field not specified or not aligned |
02 | 01 | 0004 | Log field (not aligned) |
03 | 01 | 0004 | Other fields (not aligned) |
04 | 01 | 0004 | Field address specified but field not accessible |
00 | 40 | 0005 | Insufficient space in caller’s address space |
01 | 20 | 0006 | System error |
00 | 40 | 0007 | Invalid procedure format; macro execution has been aborted |
00 | 01 | FFFF | Wrong specification for UNIT or FUNCTION in standard header |
00 | 02 | FFFF | Requested function is not supported |
00 | 03 | FFFF | Wrong version specification in standard header |
Layout of the DSECT (operand list)
CLIEXPR MF=D,PREFIX=N 1 MFTST MF=D,PREFIX=N,MACID=LIE,ALIGN=F, 1 DMACID=LIE,SUPPORT=(E,D,C,M,L),DNAME=LIEMDL 2 NLIEMDL DSECT , 2 *,##### PREFIX=N, MACID=LIE ##### 1 * Which output type 1 NLIEVSTR EQU 1 *STRING 1 NLIEVINT EQU 2 *INTEGER 1 NLIEVBOO EQU 3 *BOOLEAN 1 * 1 * parameter area description 1 NLIEHDR FHDR MF=(C,NLIE),EQUATES=NO Standard header 2 NLIEHDR DS 0A 2 NLIEFHE DS 0XL8 0 GENERAL PARAMETER AREA HEADER 2 * 2 NLIEIFID DS 0A 0 INTERFACE IDENTIFIER 2 NLIEFCTU 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 NLIEFCT DS AL1 2 FUNCTION NUMBER 2 NLIEFCTV DS AL1 3 FUNCTION INTERFACE VERSION NUMBER 2 * 2 NLIERET DS 0A 4 GENERAL RETURN CODE 2 NLIESRET DS 0AL2 4 SUB RETURN CODE 2 NLIESR2 DS AL1 4 SUB RETURN CODE 2 2 NLIESR1 DS AL1 5 SUB RETURN CODE 1 2 NLIEMRET DS 0AL2 6 MAIN RETURN CODE 2 NLIEMR2 DS AL1 6 MAIN RETURN CODE 2 2 NLIEMR1 DS AL1 7 MAIN RETURN CODE 1 2 NLIEFHL EQU 8 8 GENERAL OPERAND LIST HEADER LENGTH 2 * 1 * main return codes 1 NLIESUCC EQU 0 No error detected 1 NLIESYNT EQU 1 Syntax error 1 NLIEEVAL EQU 2 Semantic error 1 NLIETRUN EQU 3 Output buffer too small 1 NLIEAREA EQU 4 Buffer missing or not aligned 1 * or not accessible 1 NLIEREQM EQU 5 Out of memory 1 NLIEDUMP EQU 6 Invalid SDF-P-BASYS 1 * processing 1 NLIECTXT EQU 7 Old procedure context 1 * 1 NLIEIPTR DS A SDF-P expression 1 NLIEOPTR DS A Resulting value 1 NLIEPPTR DS A Resulting protocol 1 NLIEILEN DS F SDF-P expression 1 NLIEOMAX DS F Value attribute (maximum 1 * length) 1 NLIEPMAX DS F Protocol attribute (maximum 1 * length) 1 NLIEFORM DS FL1 Value attribute ( string 1 * generation ) 1 * Desired output form 1 NLIEFVAL EQU 0 *BY-VALUE 1 NLIEFSTR EQU 1 *STRING 1 * 1 NLIERES1 DS CL7 Alignment 1 NLIEOLEN DS A Value length as FW-aligned 1 * 4-byte field 1 NLIEOTYP DS A Value type as 1 byte field 1 NLIEPLEN DS A Protocol length as FW-aligned 1 * 4-byte field 1 NLIE# EQU *-NLIEHDR
Example
CLIEXPR START BALR 3,0 USING *,3 CLIEXPR MF=E,PARAM=OPLIST WROUT WROUT OUT,TERM,PARMOD=31 TERM TERM ***** DEFINITIONS ***** OPLISTE CLIEXPR MF=L,INPUT@=A(IF),INPUTL=10,OUTPUT@=A(OF),OUTPUTL=10,V- FORM=*BY-VALUE,OACTL=A(H1),OTYPE=A(H2) DS 0F IF DC CL10'(8+3)' DS 0F OUT DC Y(OUTP-OUT) DS 3X DC C'OUTPUT: ' OF DS cl10 OUTP EQU * DS CL10 DS 0F H1 DS CL4 DS 0F H2 DS CL1 END