Splitting "Name" field to FirstName,MiddleName,Las

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
saroshputhanpurayil
Participant
Posts: 6
Joined: Mon Nov 12, 2007 1:57 am
Location: mumbai

Splitting "Name" field to FirstName,MiddleName,Las

Post by saroshputhanpurayil »

Hi,

I have job with on of field is "Name"
its content can be as follows

Amjath Ali Khan 3 parts
Sarosh Puthanpurayil 2parts
James 1part
Bijo K James 2 parts

I want to map this "Name" field to ---->FirstName,MiddleName,LastName in the target file.

can any one help me to solve this problem.

thanking you.
saroshputhanpurayil
Participant
Posts: 6
Joined: Mon Nov 12, 2007 1:57 am
Location: mumbai

Post by saroshputhanpurayil »

sorry ,some corrections


Amjath Ali Khan ----------------> 3 parts
Sarosh Puthanpurayil -----------------> 2parts
James ------------------> 1part
Bijo K James ----------------> 3parts
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Parsing the string into components is simple, you can use the FIELD() function. The complexity comes in trying to figure out which part of the string goes where. If you have it, you can use the QualityStage components, if you don't you need to come up with your own rules as to determining which part of the string is which name part.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Exactly - you need to determine what each part must be when you don't have 'all three parts', and then enforce those rules.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is "James" a first name or a last name? How do you know (that is, what is your business rule)?
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