datastage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 57
- Joined: Sat Jun 09, 2007 1:14 am
- Location: chicago
datastage
There is a column called fullname in the source having the name like
"kenneth browne"
where the string before the space is first name and after space is last name
Now my question is,
In the transformer I have two columns called first name and last name
ie kenneth should be populated to first name
and
browne should be populated to last name
I am working ON PX
Could any one throw light on this
Please help me in writing the logic in transformer
"kenneth browne"
where the string before the space is first name and after space is last name
Now my question is,
In the transformer I have two columns called first name and last name
ie kenneth should be populated to first name
and
browne should be populated to last name
I am working ON PX
Could any one throw light on this
Please help me in writing the logic in transformer
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
hope we all help each other hand in hand
-
- Participant
- Posts: 5
- Joined: Wed Sep 05, 2007 3:34 pm
Re: datastage
you may use
First_Name=Field(fullname,' ', 1)
Last_Name=Field(fullname,' ', 2)
in transformer.
First_Name=Field(fullname,' ', 1)
Last_Name=Field(fullname,' ', 2)
in transformer.
Thanks & Regards,
Raghu
Raghu
-
- Participant
- Posts: 57
- Joined: Sat Jun 09, 2007 1:14 am
- Location: chicago
HI I am yet to check with that code as I dont have source data
thanks for the help
thanks for the help
Havoc wrote:Lets say input column is A
use the following in your derivation or stage variable
Set first Name To The following derivation:
A[1,Index(A,' ',1)]
Set Last Name to the following Derivation:
A[Index(A,' ',1)+1,Len(A)-Index(A,' ',1)]
Hope this helps...
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
hope we all help each other hand in hand
-
- Participant
- Posts: 57
- Joined: Sat Jun 09, 2007 1:14 am
- Location: chicago
Re: datastage
HI I am yet to check with that code as I dont have source data
thanks for the help
thanks for the help
meet_raghu wrote:you may use
First_Name=Field(fullname,' ', 1)
Last_Name=Field(fullname,' ', 2)
in transformer.
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
hope we all help each other hand in hand
Re: datastage
Why do you need the entire source data? Just plug the "FIELD" function given above in a test function and test it out with a couple of names. You should be done.karrisuresh wrote:HI I am yet to check with that code as I dont have source data
gateleys
Re: datastage
Why do you need the entire source data? Just plug the "FIELD" function given above in a test function and test it out with a couple of names. You should be done.karrisuresh wrote:HI I am yet to check with that code as I dont have source data
gateleys
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 57
- Joined: Sat Jun 09, 2007 1:14 am
- Location: chicago
px
Hi Everyone I have got new problem,
Earlier I thought of first name and last name only
Now I have prob with middle name
For example:
From the source I am getting a name called "kenneth charlie Browne"
in the transformer the name should get split into only two columns called first name and last name
In the first name column "kenneth"
In the last name column"Browne"
Can any one throw soe light on this
I am using Index and field function
but in the last name column I am getting "charlie browne" but I want only the last name"Browne"
thanks for your time
Earlier I thought of first name and last name only
Now I have prob with middle name
For example:
From the source I am getting a name called "kenneth charlie Browne"
in the transformer the name should get split into only two columns called first name and last name
In the first name column "kenneth"
In the last name column"Browne"
Can any one throw soe light on this
I am using Index and field function
but in the last name column I am getting "charlie browne" but I want only the last name"Browne"
thanks for your time
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
hope we all help each other hand in hand
-
- Participant
- Posts: 5
- Joined: Wed Sep 05, 2007 3:34 pm
Re: px
You can usekarrisuresh wrote:Hi Everyone I have got new problem,
Earlier I thought of first name and last name only
Now I have prob with middle name
For example:
From the source I am getting a name called "kenneth charlie Browne"
in the transformer the name should get split into only two columns called first name and last name
In the first name column "kenneth"
In the last name column"Browne"
Can any one throw soe light on this
I am using Index and field function
but in the last name column I am getting "charlie browne" but I want only the last name"Browne"
thanks for your time
First_Name=Field(fullname,' ', 1)
Last_Name=Field(fullname,' ', 3)
Field(fullname,' ', 3) will take the field from 2nd ' ' to 3rd ' ' or till end
thats all..
Thanks & Regards,
Raghu
Raghu
Re: px
That's if there is a middle name. You may have some names with just the first and last names, then some names with first, middle and last names, yet others with first, middle, last and suffixes, and then others with 2 names forming the middle name, or may be even 3. So, your solution has to be generic.meet_raghu wrote: You can use
First_Name=Field(fullname,' ', 1)
Last_Name=Field(fullname,' ', 3)
Field(fullname,' ', 3) will take the field from 2nd ' ' to 3rd ' ' or till end
thats all..
Let me give you a hint -
[Assumption: First name is ALWAYS written first, and last name ALWAYS at the end.]
1. Use COUNT function to count the number of spaces in the name.
2. Use the field function with the first space to get first name.
3. Use the field function with the last space occurrenece (based on Count + 1) to get the last name.
gateleys