Passing null as a parm to a parallel routine

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
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

Passing null as a parm to a parallel routine

Post by Rob4732 »

Hello Everyone,

I used the pxEreplace routine code(posted here by DSGuru2b - good code - thx). Works great. I thought I could use this code to remove a string also(by passing nothing as my replacement parm(tick tick - ''). It appears to work when I test the code in a windows c++ ide, but when I run same code in datastage, job abends with a SIGSEGV error.

I could potentially replace the unwanted string with a space and then use the Convert function to get rid of the space. Unfortunately there are other spaces in the string that I want to keep and wouldn't know which to remove.

Any suggestions appreciated. Have a good one.

Thx
We don't see things as they are;
We see them as we are.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Barring a code fix, could you replace using a character you "know" won't be in the source string? Say, something like "^" or "|" then convert that out afterwards.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

Post by Rob4732 »

That would work.

Something similar I was thinking of is to pass a value in the replace parm(something like 'REMOVE') to the routine and then alter the routine code to change the replace value to null if the replace input parm has a value of 'REMOVE'.

I think the routine will do the right thing if the replace parm can get there as null, but the passing of the null replace parm from datastage to the routine is where the hang up is in my job(I think).

I will give it a try.

Thanks
We don't see things as they are;
We see them as we are.
dougcl
Premium Member
Premium Member
Posts: 137
Joined: Thu Jun 24, 2010 4:28 pm

Post by dougcl »

You could refer this functionality to a separate routine. "RemoveSubstring"

and leave this routine for non null replacement strings.

Doug
Post Reply