How to check the white spaces in a field of Char 40 Bytes
Posted: Mon Jun 16, 2008 12:14 pm
Hi All,
I have a field named AREA2 ( char 40 bytes). Say it has the following value " JT4VN13G4W36280604 98686" and I need to check whether the first 2 bytes are spaces and replace it with another string say "AB'.
I tried the following in my transformation.
If AREA2 [1,2] = ' '
then (AREA2 [1,1] : "AB" : AREA2 [4,37])
Else AREA2
and also this
If Alpha(AREA2 [1,2]) = 0
then (AREA2 [1,1] : "AB" : AREA2 [4,37])
Else AREA2
But I am not able to replace the spaces with "AB". Please help.
I have a field named AREA2 ( char 40 bytes). Say it has the following value " JT4VN13G4W36280604 98686" and I need to check whether the first 2 bytes are spaces and replace it with another string say "AB'.
I tried the following in my transformation.
If AREA2 [1,2] = ' '
then (AREA2 [1,1] : "AB" : AREA2 [4,37])
Else AREA2
and also this
If Alpha(AREA2 [1,2]) = 0
then (AREA2 [1,1] : "AB" : AREA2 [4,37])
Else AREA2
But I am not able to replace the spaces with "AB". Please help.