p,l,fi |
This specifies the position, length, and format of an input
field. (See the description of fi below for
details.)
|
%pp,fi |
Identifies a fixed-length parsed field and format. (See the
description of fi below for details.)
|
+n |
This represents a positive numerical constant of up to 31 decimal
digits. The + sign must be specified.
|
-n |
This represents a negative numerical constant of up to 31 decimal
digits. The - sign must be specified.
|
expression |
An expression defines a numeric value. The simplest forms of an
expression consist of a numeric data input field defined either
by p,l,fi or a constant defined by +n or -n.
Expressions can also be created by connecting these simple
expressions with operators, as shown in the last line of the
above syntax illustration. Parentheses may be used to change the
default precedence order of the operators. Algebraic equations
can thus be represented with an expression.
A maximum value of 31 digits is permitted at all times in
evaluating an expression. If this is exceeded, a critical error
will be issued. Similarly, an attempted division by zero will
also result in a critical error. The results of division will be
rounded down to an integer.
Once an expression has been defined, its value can either be
converted to a numeric output data format or to a printable
numeric format using editing masks. See How to Convert
Numeric Data. The default is to use the M0 editing
mask to create printable output. The number of digits in an
expression is defined to be 31 unless the expression is a simple
p,l,fi field.
The following are expressions: +10
10,2,Y2Z
+10,ADD,10,2,Y2Z
1,4,ZD
10,2,PD
+30
1,4,ZD,ADD,10,2,PD
+30,MUL,(1,4,ZD,ADD,10,2,PD)
+30,MUL,(1,4,ZD,ADD,10,2,PD),MIN,(5,5,ZD,DIV,+100)
(+30,MUL,(1,4,ZD,ADD,10,2,PD)),MIN,(5,5,ZD,DIV,+100)
|
)
operator
|
Operations between two numeric fields or constants are performed
with operators. There are two types of operators:
function operators and arithmetic operators. The
following are the function operators:
|
|
MIN |
Generates the minimum arithmetic value of two
specified fields.
|
MAX |
Generates the maximum arithmetic value of two
specified fields.
|
|
The following are the arithmetic operators:
|
|
MUL |
multiplication |
DIV |
division |
MOD |
modulus |
ADD |
addition |
SUB |
subtraction |
The following rules of arithmetic precedence apply in computing
an “expression”: Conditions within parentheses are evaluated first,
from innermost to outermost parentheses.
The arithmetic functions of minimum and maximum (MIN
and MAX) are performed before the arithmetic
operators (MUL, DIV, MOD, ADD, SUB). Within the
arithmetic operators, multiplication (MUL), division
(DIV), and modulus (MOD) are performed before
addition (ADD) and subtraction (SUB). Operations
within the same precedence level are performed from
left to right.
The result of the DIV operation is truncated (rounded
down) to an integer. The MOD operation produces an
integer remainder with the sign of the dividend.
|
fi |
Use this parameter together with p,l to define the
input format of a numeric field that is part or all
of an expression. The expression will then be converted to
either another numeric data format or to a printable format. In
such cases, indicate the format of the data field that is to be
converted by replacing fi with BI, FI, FL, PD,
ZD, CSF/FS, PD0, SFF, UFF, one of the SMF formats (DT1, DT2,
DT3, TM1, TM2, TM3, and TM4), time-of-day (TOD) formats (DC1,
DC2, DC3, TC1, TC2, TC3, TC4), extended time-of-day (ETOD)
formats (DE1, DE2, DE3, TE1, TE2, TE3, TE4), or one of the year
data formats (Y2B, Y2C, Y2D, Y2P, Y2S, Y2Z, Y2T, Y2U, Y2V, Y2W,
Y2X, Y2Y, Y4T, Y4U, Y4V, Y4W, Y4X, Y4Y).
Also use this parameter when a 2-digit packed decimal year value
is to be expanded to a 4-digit packed decimal value. In such
cases replace fi with Y2ID or Y2IP. The Y2ID
and Y2IP formats cannot be used to form complex arithmetic
expressions and do not allow the specification of mask (Mm),
EDIT, SIGNS, or LENGTH.
An l value indicating the length of the field must be
specified in accordance with the following allowable values:
for BI ... 1-8 inclusive
for CSF or FS ... 1-16 inclusive (15-digit limit)
for CSF or FS ... 17-32 inclusive (31-digit limit)
for FI ... 1-8 inclusive
for FL ... 4 or 8
for PD ... 1-16 inclusive
for PD0 ... 2-8 inclusive
for SFF ... 1-44 inclusive (31-digit limit)
for UFF ... 1-44 inclusive (31-digit limit)
|
fi |
for Y2B ... 1
for Y2C ... 2
for Y2D ... 1
for Y2ID ... 1
for Y2IP ... 2
for Y2P ... 2
for Y2S ... 2
for Y2Z ... 2
for ZD ... 1-31 inclusive
for Y2T ... 3-6 inclusive
for Y2U ... 2-3 inclusive
for Y2V ... 3-4 inclusive
for Y2W ... 3-6 inclusive
for Y2X ... 2-3 inclusive
for Y2Y ... 3-4 inclusive
for Y4T ... 7 or 8
for Y4U ... 4
for Y4V ... 5
for Y4W ... 7 or 8
for Y4X ... 4
for Y4Y ... 5
|
fi |
Field conversion of a single p,l,fi expression
with a format of Y2x, Y2xx, Y4x does not default to the
use of the M0 default output mask. Y4x fields will be converted
to printable format and for Y2x/Y2xx fields the default will
convert the 2-digit year portion to a 4-digit 4-byte printable
year. The year portion of the date is converted using the
century window defined by the CENTWIN parameter. The century
window is not used for the special values, which are only
expanded with characters of the proper format. However, except
for Y2S, Y2x and Y4x, fields can be used to form expressions
with operators. In this case, the default will use the M0 output
mask with a number of decimal digits determined by the terms
used in the expression. For more information, see How to Convert
Numeric Data. The specification of an output numeric
data format fo or mask Mm, EDIT, SIGNS,
or LENGTH is permitted except when using Y2S, Y2ID, and
Y2IP.
Field conversion of a single p,l,fi expression
with a format of FL will convert a hexadecimal floating point
value (4-byte or 8-byte) to a signed integer in the range of
-9223372036854775808 to 9223372036854775807, with the fractional
part of the FL value dropped. A z/Architecture environment is
required before specifying FL format; otherwise, an error
message and termination of the application will result.
|
|