Doing a right trim for a string

Hi,
I need to perform a right justification on a string. For eg,

#STR = "ROBERT SCHAZZ "

I want the content of #STR to be just “ROBERT SCHAZZ”

Is there any specific keyword in Natural to remove the extra spaces from the end?

Thanks in Advance
Sam

On Natural for Windows, there is a System funktion called *TRIM.

For Example:

DEFINE DATA LOCAL
1 #a (A) DYNAMIC init <"ROBERT SCHAZZ ">
end-define
display *LENGTH(#a)
#a := *TRIM(#a)
display *LENGTH(#a)
end

What about a simple
COMPRESS #A INTO #A
This should work also on NAT MF versions without the trim()
Finn

With a DYNAMIC variable a simple MOVE ‘ROBERT SHAZZ’ TO #STR will suffice.

On a mainframe, without a DYNAMIC variable, you would have to explain your desired output a bit more. Suppose #STR is defined as A20. Do you want ROBERT SHAZZ followed by binary zeroes?

steve