The LEN() or STRLEN() built-in functions return the length of the data stored in the Session Variable.
The LEN() or STRLEN() built-in functions return the number of characters stored in the identified Session Variable. It can be used on an assignment, conditional or looping statement.
select upc INTO &UPC
FROM products
WHERE itemNbr = 3741;
if (&SQLState < '02000');
if (len(&UPC) = 12);
// do 12-position UPC processing here
elseif (len(&upc) = 13);
// do 13-position UPC processing here
else;
// handle the rest here.
endif;
endif;