if we have a variable Picx(10),i want to pass a string "resh"into itwhich is of only 4 size.Then,how can we find out the actual length of the string when it contains spaces in cobol?
if we have a variable Picx(10),i want to pass a string "resh"into itwhich is of only 4 size.Then,how can we find out the actual length of the string when it contains spaces in cobol?
say a Variable has ws-name pic X(10)
and the text as "radi"
declare another variable with pic 9(2) or something
say ws-count pic 9(2)
then
INSPECT WS-NAME TALLYING WS-COUNT FOR CHRACTERS BEFORE INITIAL ' '.
WS-COUNT would have the actual length.