Character after "-" should be Capital letter

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
pavankatra
Participant
Posts: 86
Joined: Wed Mar 03, 2010 3:09 am

Character after "-" should be Capital letter

Post by pavankatra »

Hi,
my requirement is like

Character after "-" should be Capital letter

Ex:

input:
hi this - is dsxchange forum.
output:
hi this - Is dsxchange forum.
Can anyone please suggest me how to accomplish this.

Thanks In advance.

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Noting that you may need to modify the expression because of the space following the "-" character one solution is

Code: Select all

If Index(InLink.TheString, "-", 1) > 0 Then Field(InLink.TheString, "-", 1, 1) : "-" : UpCase(Left(Field(InLink.TheString, "-", 2, 1))) : Right(Field(InLink.TheString,"-",2,1),Len(Field(InLink.TheString, "-", 2, 1) -1) Else InLink.TheString
You could (should) extract the common subexpression into a stage variable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pavankatra
Participant
Posts: 86
Joined: Wed Mar 03, 2010 3:09 am

Post by pavankatra »

ray.wurlod wrote:Noting that you may need to modify the expression because of the space following the "-" character one solution is

Code: Select all

If Index(InLink.TheString, "-", 1) > 0 Then Field(InLi ...[/quote]

Hi Ray,

Thanks for your reply

 i am not premium user.If you dontmind can you please elaborate that.And one more thing i need to do capital letter after hiphen(-).

Thanks in advace
battaliou
Participant
Posts: 155
Joined: Mon Feb 24, 2003 7:28 am
Location: London
Contact:

Post by battaliou »

Ha ha ha. Thats excellent.
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A simple remedy for your dilemma exists here.

I posted a full answer.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply