Need Help To implement pxEreplace()

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
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Need Help To implement pxEreplace()

Post 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
Manoj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Just locate your "PXEngine/lib" directory and copy it there using the full path.
-craig

"You can never have too many knives" -- Logan Nine Fingers
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Post by hi_manoj »

That is not happening. Not able to locate PXEngine/lib. Is there any command that will help me to find path?
Manoj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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
-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 »

/opt/IBM/InformationServer/Server/PXEngine is the default location.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Post 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.
Manoj
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Post 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
Manoj
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Post by hi_manoj »

Dear Guru's, Please share your suggestions.
Please let me know if you need any input from my side.

Regards
Manoj
Manoj
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post 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.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Post 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).
Phil Hibbs | Capgemini
Technical Consultant
Post Reply