splitting a string into three fields

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

code tags did not help . when i previewed the data , it is trimming the spaces .

may be i am using it incorrectly.

i did something like this

[code]a b[/code]

results in single space between a and b
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

i fixed the problem .

i changed the order of my stage variables.

i had vcount -Dcount(sv1,' ')
sv1-Trim(src_hcrs.City_State_Zip)


now it is sv1 first and vcount next .
i am extremely sorry for my act of ignorance.

the logic is working and the results are as i expected.

Thank you everyone

paddu
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Code tags work, not sure what your issue was.

Code: Select all

Each  word  has  two  spaces  between  them.
Each word has one space between them.
Thank you for confessing your sins, My Son. It helps other supplicants who come here searching for answers from going astray.

With your original stage variable order, you were dcounting the field from the previous record, which is why it wasn't behaving as you expected. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Paddu, Our Father was explaining how to represent the data in this forum, by enclosing in Code. As in the previous post. The sentence "Each word has one space between them." was within code tag which gives more clear picture and the same in this post didn't.
Hope you haven't toyed something with you code. :wink:
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Tags, including Code tags, are affected by the check boxes at the bottom when you reply, especially "Disable BBCode in this post".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

True - checking that for some reason would shut down the functionality of [b]all[/b] tags. I would [i]guess[/i] you'd only do that if you were tutoring someone on what the tags would look like in your [color=red]still evolving post[/color]... or some such. :wink:
-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 »

Or just accidentally checked the box on your way down to the Submit button!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

Ray

I am your daughter :) not SON

I see that Disable BBCode in this post option is checked for me by default.
i unchecked it

Code: Select all

It's  working   now
:D
Last edited by paddu on Thu Mar 08, 2007 1:54 pm, edited 2 times in total.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

paddu wrote:Ray
I am your daughter :) not SON
Are you kidding!! :?
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

what do you mean by "Are you kidding".

I am a female not Male .
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

I mean to say that is the wrong interpretation.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

us1aslam1us ,

Ray addressed me as Son in one of his posts .So i just corrected. that's it.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

:lol:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That was me. My apologies. Hard to know gender in all cases, even with English names - and don't get me started on 'handles'... like 'DSGuru2B'. For all I know 'he' is a very clever PHP script. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Aren't we all, scripted by the ultimate ENTITY :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply