Suppose I have a variable called VAR of size 50 character. This variable stores different vales at different instance of a loop. I want to know the length of the content it stores. Suppose in one instance it stores "My name is Kunal" in this particular case the length of the content of VAR is 16. Can some one help me with RPGLE logic which can help me get the length of the content.
As jtaylor___ said, use %len(%trim(var)) to get the length. Or use %trimr, %len(%trimr(var)), if the value might have leading blanks that should be counted as part of the length. For example, if the value is ' abc ' you might want the length 4, not 3.