Creating shared libraries for buildops

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
devnull
Premium Member
Premium Member
Posts: 37
Joined: Wed Mar 29, 2006 11:17 am
Location: Minneapolis, MN USA

Creating shared libraries for buildops

Post by devnull »

Has anyone out there had any experience on creating shared libraries for custom buildops to use? Can this be done? Where (dare I ask?) is the documentation for it, if it can be done.

Thanks.
Michael Mabin
Minneapolis, MN USA
d3vvnull@com.gmail
(Reverse com and gmail to send email)
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

Hey, I'm in the same development group as 'devnull'. Here's a few more details.

We have a set of functions that we use in many of our buildops. Right now, we include a header file in our buildops to access those functions. The problem is that if we have to change a function, we have to recompile all buildops that use it. If we use a shared library instead, we do not have to recompile buildops when we update the library.

For the sake of conversation, assume we have a header file with this one function (convertDate6toISO) in it:

Code: Select all

APT_Date convertDate6ToISO(APT_String, APT_Int32);
APT_Date convertDate6ToISO(APT_String inputDtStr, APT_Int32 cutoff=50) {
    // Input date string format is 0YYMMDD
    APT_String century;
    APT_Date outDt;

    if (inputDtStr.substring(0,2).asInteger() < cutoff) {
        century = "20";
    } else {
        century = "19";
    }
    outDt.set(century + inputDtStr, "%yyyy%mm%dd");

    return outDt;
}
FYI - this function converts a string containing a 6-digit numeric date, formatted yymmdd, to a valid DataStage date datatype, including century.

Say we want to change the default cutoff from 50 (i.e. 1950) to 49 (bad example, but you get the idea). If we continue to use this header, then all buildops that use this header have to be recompiled. If we instead used a shared library, all we have to do is push the new version out to production and all buildops that reference it will use the new version automatically - no recompiling.

I think the biggest issue is that we don't know how to compile this with the right DataStage headers and libraries.

Sooo, any help would be greatly appreciated!!

Brad.
Abhijeet
Participant
Posts: 20
Joined: Wed Jul 27, 2005 1:00 am

Post by Abhijeet »

Hi guys,

I have worked on such a thing ... creating SO libraries for buildops , because we didn't wanted to recompile the job.

I am sending u a link .. this has it all , how to create the SO libs and how to call them ...

http://www.faqs.org/docs/Linux-HOWTO/Pr ... HOWTO.html

Have fun :D

~Abhi
devnull
Premium Member
Premium Member
Posts: 37
Joined: Wed Mar 29, 2006 11:17 am
Location: Minneapolis, MN USA

Post by devnull »

Abhijeet wrote:Hi guys,

I have worked on such a thing ... creating SO libraries for buildops , because we didn't wanted to recompile the job.

I am sending u a link .. this has it all , how to create the SO libs and how to call them ...

http://www.faqs.org/docs/Linux-HOWTO/Pr ... HOWTO.html

Have fun :D

~Abhi
This is a great link but it's for Linux and GNU cc. It's also not specific to the DataStage environment. My questions are more about how to tell DataStage where by shared libraries are (dynamic or static) so that a custom buildop can use them. I've tried adding a -L option and a -l option to the linker settings, but it looks like here it may even be replacing the APT framework and utility libraries with my own.
Michael Mabin
Minneapolis, MN USA
d3vvnull@com.gmail
(Reverse com and gmail to send email)
Post Reply