Command Reference 5-53
LEFT
Purpose Extracts the left-most character from a string.
Syntax LEFT
buffer-field1
,
buffer-field2
,
length
[
,
[
invalid label
] [
, valid label
] ]
Process The LEFT command extracts the left-most characters from
buffer-field1
and copies
them into
buffer-field2
.
Length
specifies the number of characters.
The
buffer-field
fields can be one of the following:
Buffer-field1 2
and
Length
Description
INPUT Input Buffer
Logical Field Name
(TEMP1)
Temporary Buffer
Field
Logical Field Name (LU1) Lookup Buffer Field
Logical Field Name (PR1) Printer Buffer Field
Logical Field Name
(Field1) [Index]
Array Buffer Field
Buffer-field1
and
length
only:
Number
Number prefixed by a
number sign (#)
Buffer-field1
only:
String
ASCII string delimited
by double quotes
Rule:
Length
must be numeric.
Optional Fields
Invalid
and
valid labels
are discussed in "Script Flow" at the beginning of this
chapter.
Example 1
This example extracts the five left-most characters from SHIP_NO and copies them
to SKU.
LEFT SHIP_NO,SKU,#5
Example 2
This example extracts the NUMCHARS left-most characters from SHIP_NO and
copies them to SKU.
LEFT SHIP_NO,SKU,NUMCHARS
See Also
LSTRIP
MID
RIGHT
RSTRIP