Salva
Salva

Reputation: 113

How to convert the records in a column to Camel Case in Datastage?

I have a table in which i have a name column, The names in that column are all lower case .I want to convert the string to camel case .The table headers are a follows Table |Id|Name |Phone Number| |01|bob wheeler|999999999 |

Upvotes: 0

Views: 547

Answers (3)

Chinmay
Chinmay

Reputation: 11

Assuming name column only contains first name and Last name. If there is middle name as well, you can simulate the formula to handle that.

The formula will convert first char after first occurrence of space to upper case. It will concatenate first name, first character of second name with upper case and then rest of the second name. You can play with positions if getting wrong output. But this would definitely work-

left(NAME,Index(NAME,' ',1)) : Upcase(Name[(Index(NAME,' ',1))+1,1]) : Name[(Index(NAME,' ',1))+2,length(NAME)-Index(NAME,' ',1)+1]

Upvotes: 0

Ray Wurlod
Ray Wurlod

Reputation: 851

If you are trying to do this in a server job, then use Oconv(InLink.MyString,"MCT").

There is no directly-available function in a parallel Transformer stage. You could: (a) put a server Transformer in a server Shared Container and use that in your parallel job, (b) write your own routine in C++ and refer to it (called a "parallel routine"), or (c) investigate whether the database in which the table resides has any kind of camel case conversion function.

Upvotes: 1

MichaelTiefenbacher
MichaelTiefenbacher

Reputation: 4005

I don't think there is a specific function for that.

UpCase is available.

You migh consider a workaround to convert the first and every other first character ater a blank to upper case.

Upvotes: 0

Related Questions