LET (set variable length)
LET, in combination with the LENGTH parameter, sets variable1 in a statement to the length of variable2.
As a result, the first variable becomes a 3-digit value between 000 and 256, depending on the length of the second variable.
Syntax
LET variable1 = LENGTH variable2
where
- variable1 is the name of a variable or array element to receive a length value. variable1 can be a character string, a numeric variable, or an array element.
- variable2 is the variable whose length will be assigned to variable1.
Example
The following example keeps the length of file and transaction names to 70 characters or less:
LET <R = LENGTH &TRNID(&K)
IF <R > 70 THEN GOTO LAB3
IF <R > 70 THEN GOTO LAB3
Related topic
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*