Page 1 of 1

Passing null as a parm to a parallel routine

Posted: Thu May 05, 2011 10:36 am
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

Posted: Thu May 05, 2011 12:47 pm
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.

Posted: Thu May 05, 2011 3:25 pm
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

Posted: Fri May 06, 2011 12:20 pm
by dougcl
You could refer this functionality to a separate routine. "RemoveSubstring"

and leave this routine for non null replacement strings.

Doug