04-29-2009 9:07 PM
Hello,
I am having trouble understanding translate statement.
DATA: LETTERS(4) VALUE 'YaaX',
CHANGE(4) VALUE 'aXba'.
TRANSLATE LETTERS USING CHANGE.
WRITE: LETTERS.
The output is 'YXXX'. But I am not sure why this is.
I thought that every letter that exists in another letter gets replaced by the letter that follows it and if does not exit then it remains unchanged. So b does exist after X but still the output shows X at end and not b as below.
So the output should be 'YXXb'.
Please help
Regards,
Jainam.
Edited by: Jainam Shah on Apr 29, 2009 10:08 PM
04-29-2009 9:12 PM
In your example it replaces a with X and b with a. TRANSLATE works with groups of two letters.
Rob
04-29-2009 9:12 PM
In your example it replaces a with X and b with a. TRANSLATE works with groups of two letters.
Rob
04-29-2009 9:14 PM