Page 1 of 1

Need Help To implement pxEreplace()

Posted: Thu Nov 14, 2013 8:55 am
by hi_manoj
Hi,

I am trying to implement something like this for the first time, and need help from you.

I have taken the latest code by Phil Hibbs. Then as per below instruction I follow.

1. Copy the source code to a file pxEreplace.cpp into my home directory
2. Run below command
/opt/SUNWspro/bin/CC -dalign -O -PIC -library=iostream -c -xarch=v9 pxEreplace.cpp
And that creates a pxEreplace.o file in the same directory
3. Copy the output from the same directory into the DataStage library directory
cp pxEreplace.o `cat /.dshome`/../PXEngine/lib/pxEreplace.o

Step 3 is failing
cat: cannot open /.dshome
cp: cannot create /../PXEngine/lib/pxEreplace.o: No such file or directory

Posted: Thu Nov 14, 2013 8:57 am
by chulett
Just locate your "PXEngine/lib" directory and copy it there using the full path.

Posted: Thu Nov 14, 2013 9:07 am
by hi_manoj
That is not happening. Not able to locate PXEngine/lib. Is there any command that will help me to find path?

Posted: Thu Nov 14, 2013 9:36 am
by chulett
Are you not familiar with the find command in UNIX? Searching for "PXEngine" should turn everything up. Bare minimum would be:

Code: Select all

find / -name PXEngine -print

Posted: Thu Nov 14, 2013 2:23 pm
by ray.wurlod
/opt/IBM/InformationServer/Server/PXEngine is the default location.

Posted: Fri Nov 15, 2013 1:18 am
by hi_manoj
I copied the pxEreplace.o to my PXEngine/lib directory
(/unit/sys/IS91/IBM/Infoserver/PXEngine/lib)

And after setting the parallel routine properties I have called the rountine from a transformer pxEreplace(lnkReadInvRel.InvestmentID, ".OLD", "", 1,0). The job aborted with below error

Failed to load the library "V0S3_CopyOfG_TRANS_INV_RELIEF_SETUP_xfmTransInvRelSetup.so"; either the directory containing the library file
is not on the library search path, or the library was compiled on a system
that is incompatible with this system: Could not load "V0S3_CopyOfG_TRANS_INV_RELIEF_SETUP_xfmTransInvRelSetup": ld.so.1: osh: fatal: relocation error: file /unit/apps/nylim/IS87/projects/nylim-GENEVA/RT_BP256.O/V0S3_CopyOfG_TRANS_INV_RELIEF_SETUP_xfmTransInvRelSetup.so: symbol __1cKpxEreplace6FWWWii_pc_: referenced symbol not found.

Posted: Fri Nov 15, 2013 8:51 am
by hi_manoj
I have gone through the old post on this error message, I force compile the job, rename the transformer stage but the error is same.

Few Input that may help you.
command to create the .o file
/opt/SUNWspro/bin/CC -dalign -O -PIC -library=iostream -c -xarch=v9 /unit/sys/IS91/IBM/Infoserver/PXEngine/lib/pxEreplace.cpp

Properties :
Routine Name: pxEreplace
Type: External Function
External Sub routine name: pxEreplace
Object Type: object
Return: char*
Lib Path: /unit/sys/IS91/IBM/Infoserver/PXEngine/lib/pxEreplace.o

Posted: Mon Nov 18, 2013 1:59 am
by hi_manoj
Dear Guru's, Please share your suggestions.
Please let me know if you need any input from my side.

Regards
Manoj

Posted: Mon Nov 18, 2013 10:23 am
by asorrell
What operating system are you on? It sounds like the problem may have to do with compiler options / compatibility.

Since Phil is the expert on the routine, you might want to send him a private message with a request to check out this topic (include the URL) to see if he can please assist.

Posted: Tue Nov 19, 2013 7:07 am
by PhilHibbs
pxEreplace is a bad idea. It is impossible to implement a string replacement function in DataStage without introducing either contention or a memory leak*. Sorry. What IBM desperately need to do is to allow std::string parameters (and return type) for parallel routines. That is, after all, precisely what std::string was invented for.

* There may be some way to use a static buffer, but you would have to make sure that two threads don't both try to access the same buffer at the same time.
hi_manoj wrote:Step 3 is failing
cat: cannot open /.dshome
Is there a file in your root directory called .dshome? Can you try the following command:

cat /.dshome

If that says that it cannot open the file, then I would say that your DataStage environment is not set up correctly as that file has always existed on all the systems that I've worked on. Maybe someone else can help with that part, I'm no expert on installing and setting up DataStage.

Unfortunately I don't have any more time to look into this, and don't have access to a DataStage environment anyway (working on an Oracle project at the moment).