Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue getting TRANSLATE statement working....

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

In your example it replaces a with X and b with a. TRANSLATE works with groups of two letters.

Rob

2 REPLIES 2

Former Member
0 Kudos

In your example it replaces a with X and b with a. TRANSLATE works with groups of two letters.

Rob

former_member156446
Active Contributor
0 Kudos

Hit an F1 on TRANSLATE and check the documentation.