SIZE returns a FIXED BINARY value giving the implementation-defined
storage, in bytes, allocated to a variable x.
 >>-SIZE(x)-----------------------------------------------------><
|
- x
- A variable of any data type, data organization, alignment,
and storage class, except as listed below.
x cannot be:
- A BASED, DEFINED, parameter, subscripted, or structure or union
base-element variable that is an unaligned fixed-length bit string
- A minor structure or union whose first or last base element
is an unaligned fixed-length bit string (except where it is also
the first or last element of the containing major structure or union)
- A major structure or union that has the BASED, DEFINED, or parameter attribute,
and which has an unaligned fixed-length bit string as its first
or last element
- A variable not in connected storage
The value returned by SIZE(x) is the maximum number of bytes
that could be transmitted in the following circumstances:
declare F file record input
environment(scalarvarying);
read file(F) into(x);
If x is:
- A varying-length string, the returned value includes the length-prefix
of the string and the number of bytes in the maximum length of the
string
- An area, the returned value includes the area control bytes
and the maximum size of the area
- An aggregate containing areas or varying-length strings, the
returned value includes the area control bytes, the maximum sizes
of the areas, the length prefixes of the strings, and the number
of bytes in the maximum lengths of the strings.
The SIZE built-in function must not be used on a BASED variable
with adjustable extents if that variable has not been allocated.
Under the CMPAT(V3) compiler option, SIZE returns a FIXED BIN(63) value.
Under all other CMPAT options, it returns a FIXED BIN(31) value.
To get the number of bytes currently required by a variable,
as opposed to the number of bytes allocated to it, use the CURRENTSIZE
built-in function. See CURRENTSIZE for more details.
|
This information center is powered by Eclipse technology. (http://www.eclipse.org)