Within the latest Technology Refreshes, IBM i 7.5 TR3 and 7.4 TR9, are a couple of new RPG Built in Functions, BiF, that can make it easier to get the leftmost or rightmost characters from another variable.
The new BiF are:
%LEFT: gets the leftmost characters
%RIGHT: gets the rightmost characters
The syntax is the same for them both:
Result = %left(< string or variable > : < number of characters to get > :
< charcount constant >) ;
Result = %right(< string or variable > : < number of characters to get > : < charcount constant >) ;
Read more » Read More