Page 1 of 1

Reverse a string

Posted: Thu Sep 09, 2004 10:15 am
by josy
Hi all,

Is there any function or routine which will reverse a string?

For example abcdef has to become fedcba.

Regards

Josy

Re: Reverse a string

Posted: Thu Sep 09, 2004 11:57 am
by jseclen
Hi Josy,

I think there isn't a function in DataStage for that , but i send a code that reverse any string ...

Cad = ''
For i=1 to Len(x)
Cad = x[i,1] : Cad
Next
Ans = Cad

I hope this help.

:lol:

Posted: Thu Sep 09, 2004 4:20 pm
by ray.wurlod
Creating this function is one of the "fun" exercises in the Programming with DataStage BASIC class. :D