Page 1 of 1

Migrate server routines to parallel

Posted: Thu May 19, 2016 5:49 am
by kumarjit
Hi there.

I am undertaking a project assignment to convert a set of Server Routines into parallel ones, but I have never worked on routines before, and I am totally unaware of the server routine constructs.

The logic of one of the server routines that I need to replicate is given below.
This routine will run a job(I am interpreting this a executing the DSJOB command) that reads records from a source file and loads it into a target table.

I am not able to find an tutorial/IBM documentation in this regard.
Its an earnest request to all to give me a lead/share any online resource to get things rolling at least. :)

Warm Regards,
Kumarjit,

Posted: Thu May 19, 2016 6:56 am
by chulett
Why? The places where those server routines are used really don't support parallel versions. :? And there is no "given below", wondering if you meant to post the BASIC code.

What kind of help are you looking for, the BASIC reference? If so, there is this online reference and as it mentions you also have (or can get) the InfoSphere DataStage BASIC Reference Guide pdf.

Posted: Thu May 19, 2016 7:23 am
by kumarjit
@Craig: The answer for "Why" would be a decision by the client and my company, I am only a way to implement it.
As far as providing a sample logic goes, I cannot paste the actual server routine code here in this forum, hence I quoted it as a "logic" of the code piece rather than code itself.
Furthermore, I'm neither knowledgeable of the BASIC programming constructs for server routines, nor do I know how to write a Parallel routine which can be called from within a parallel transformer and can perform functions such as validating the existence of a file in a file path, or running a Datastage job, or retrieving the details of the last run of a job .

My question was: I need guidance to try if this kind of server to parallel migration of routines is possible. If so, is there any specific documentation that can help me analyze the existing server routines and re write it as a parallel one.

Regards,
Kumarjit.

Posted: Thu May 19, 2016 8:02 am
by chulett
Wow, that sucks for you to draw the short straw for the task, this is especially tough for someone with no knowledge of neither the 'before' nor the 'after' product. Never mind that this is (in my humble opinion) a complete waste of time and resources. Moving on...

To again attempt to answer your question, at its most simple: no, there isn't any kind of specific "routine migration" document that I've even seen or heard of. I've provided what exists for the BASIC side and there is all kinds of documentation on what is needed to create PX routines in C++ and call them from the parallel framework. Search here and online at the official IBM sites are your friend for that.

In your shoes I'd be involving your official support provider and be asking them, see if they've helped people do this in the past and have any such documentation they would be willing to share.

Posted: Thu May 19, 2016 1:08 pm
by chulett
From the "How do I create a C++ routine and call it from DataStage?" department, this should be a good starting point. It's for 8.5 but I don't believe the specifics have changed, if you dig around there you should be able to find the 11.x version of this documentation.

General question to the home audience - has this changed at all in the later releases?

Posted: Thu May 19, 2016 4:38 pm
by ray.wurlod
No changes to how parallel routines are implemented.

The ONLY guaranteed way to "convert" server routines to parallel routines is to reverse-engineer the logic of the routine into a set of algorithms (a manual process) then write the C++ code to implement those algorithms (another manual task).

You can garner some ideas by looking at the C++ source code that is produced when expressions in a Transformer stage are compiled.

Posted: Thu May 19, 2016 5:54 pm
by qt_ky
Every example you have given for a routine is a single task / sequential operation. There are no benefits of rewriting them into parallel routines. Sorry, but I think your client needs guidance as to why not to waste time and effort on this. What is it Ray always says... resist stupid requirements!

Posted: Mon May 23, 2016 2:07 pm
by Teej
chulett wrote:General question to the home audience - has this changed at all in the later releases?
Nope. Other than changing the supported compiler (which may require that you tweak your makefile), nothing have really changed in this area.

BTW, the 11.5 doc:

http://www.ibm.com/support/knowledgecen ... ml?lang=en

-T.J.