Server routine in a parallel job with a Basic transformer?

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

ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Server routine in a parallel job with a Basic transformer?

Post by ady »

Hi,

I am using a Basic transformer in a parallel job, can I use a server routine in that transformer ?. I am trying to do it and is is not working.

thanks
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

What's not working? Please provide more detail.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

The routine is written to strip off some unwanted characters which are present in a given column. But when i run the job the routine does not remove the characters, they are still there.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

Ans = ""
FOR I = 1 to LEN (InputString)
ASCIICode = Seq(InputString[I,1])
IF ASCIICode >= 32 AND ASCIICode <= 122 AND ASCIICode <> 91 AND ASCIICode <> 93 AND ASCIICode <> 94 THEN Ans = Ans : InputString[I,1]
NEXT I





Thats the code for the routine, I need to get this routine working in the basic transformer or write it as a derivation for a column.

Can anyone help me do it ?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Do you get any error messages in the log? Did you test the routine via the test button while creating it?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

Yes the routine works, I have tested it and it is also been used in other server jobs. But this is a totally different scenario.... basic transformer in a parallel job
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

There are no warning in the log file ..
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

<img src="http://img15.imgspot.com/u/07/59/19/unt ... 794506.JPG">


Thats the test output for the routine
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Inside the job, make sure you the column that your running this routine on, is defined as varchar and you trim the column before passing it in.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Post by sud »

You can only use a server component in a parallel job if it is a SMP system. So please check that first.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

See if that routine works with the same input in a server job?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

@ DSguru

The same column from the same source is been used in a server job and the routine works for it. i am comparing my parallel output with that server output to check if the routine is working.

My datatype is char, and yes i am trimming the values.


@ SUD

How can i find out if i am on a SMP system ?


Can i duplicate that routine functionality as a derivation ??


Thanx guys..
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Not char, it should be varchar. Change it to varchar so that you can trim the spaces.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

Ok , i will convert to varchar and try. But the routine is written in such a way that it works with data that has spaces too, as you can see in the picture above... it leaves spaces as spaces.

I will try and let you know .... thanx
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

It should work but right now we are just shooting in the dark. Lets see which arrow hits bullseye. From a glance, nothing seems wrong with the routine and it should work in a px job just as it works in a server job. Write a px routine for it. I remember posting a routine that works with ascii numbers. You should be able to tweak it.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply