Page 1 of 1

Posted: Fri Feb 19, 2010 8:57 am
by chulett
You have to 'duplicate the code'. Treat one project as the 'master' project and promote the common routine everywhere else (read only) that it needs to be used.

Posted: Fri Feb 19, 2010 3:25 pm
by ray.wurlod
You can acually "globally catalog" the routine.

But this involves a number of steps and will not be supported by IBM, so any maintenance issues will be your own.

Essentially the steps are as follows:
  • copy the source code into a Type 19 file (create one if you don't have one - CREATE.FILE DSU_BP 19 will suffice as a command) including the FUNCTION or SUBROUTINE definition, the RETURN function/statement and a terminating END statement

    compile (for example BASIC DSU_BP MyRoutine)

    catalog using a name that begins with an asterisk (for example CATALOG DSU_BP *MyRoutine)

    call or declare your routine with the asterisk prefix (for example DEFFUN MyRoutine(Arg1, Arg2) CALLING "*MyRoutine")
These steps are all disclosed in the DataStage BASIC manual.

Posted: Fri Feb 19, 2010 4:06 pm
by chulett
True, but us mere mortals duplicate the code. :wink:

Posted: Sat Feb 20, 2010 2:30 pm
by ray.wurlod
It has since occurred to me that, because it's in IBM's manual, they would have to support it.

And it IS used in the product itself. Any job sequence will have calls to *DSR*Message, for example.

Posted: Mon Feb 22, 2010 8:24 am
by gpbarsky
Thank you, but I couldn't see Ray's complete answer.

Anyway, I'll duplicate the code. This is only transporting of one component.

Have a good week.