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.
Creating shared libraries for buildops
Moderators: chulett, rschirm, roy
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:
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.
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;
}
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.
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
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.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