The
system function VGLib.copyBytes copies one field
to another.
As is true in
StrLib.copyStr, the source and
target may be of a character type. In the current function, the
source also may be any of the following types:
- BIN (or the integer equivalents BIGINT, INT, and SMALLINT)
- DECIMAL
- NUM
- NUMC
- PACF
StrLib.copyBytes(
target a character type inOut,
targetSubIndex INT in,
targetSubLength INT in,
source BIN, DECIMAL, NUM, NUMC, PACF, or a character type in,
sourceSubIndex INT in,
sourcetSubLength INT in)
- target
- Field or literal from which a target substring is derived.
- targetSubIndex
- Identifies the starting byte in target, given
that the first byte in target has the value 1. This
index can be an integer literal. Alternatively, this index can be an item
defined as type INT or the following equivalent: type BIN with length 9 and
no decimal places.
- targetSubLength
- Identifies the number of bytes in the value that is derived from target.
The length can be an integer literal. Alternatively, the length can be a field
defined as type INT or the following equivalent: type BIN with length 9 and
no decimal places.
- source
- Field or literal from which a source value is derived.
- sourceSubIndex
- Identifies the starting byte of the value in source,
given that the first byte in source has the value
1. This index can be an integer literal. Alternatively, this index can be
a field defined as type INT or the following equivalent: type BIN with length
9 and no decimal places.
- sourceSubLength
- Identifies the number of bytes in the value that is derived from source.
The length can be an integer literal. Alternatively, the length can be an
item defined as type INT or the following equivalent: type BIN with length
9 and no decimal places.
If the source is longer than the target, the source is truncated. If the
source is shorter than the target, the source value is padded with blanks,
even if that value is numeric.