Equate Function is used to Equate the Routine Name to a literal string and others as the first code.
By doing this, I cannot access it from the drop down list of routines in transformer. But once I've removed the EQUATE function, this function appears in the routines list.
Can anyone explain what is the main use of EQUATE function? And what impact will it bring to the codes by having it or excluding it?
Routines only appear in the drop-down list if the Routine has been successfully compiled. You may also need to refresh the Transformer (from the menu, or use Ctrl-R).
Equate is used in two ways, to define a constant or to define a single-line macro. The first two examples define contants.
These routines are successfully compiled. Even though the transformer is refreshed, the routines with the Equate function does not seems to appear in the Routines list.
Is it a good practice to use the EQUATE function to define constants in the arguments and the routine name?
Is each routine of type "transform function"? Only transform functions are visible in the DS Routines list.
I'd be a bit concerned, too, that you've overloaded the name of an intrinsic function (Num) in an Equate declaration.
It's better, in my view, to use assignment statements or literal Equate declaration (Equate TheNumber Lit "Arg1") if you're seeking to avoid side effects in your Routine arguments.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
If num < 0 Then
Ans = NEG(num)
End Else
Ans = num
End
The above code appears in the routines list in the transformer. (It has been compiled successfully)
Changes in routines require the dsjob that calls this routine to be re-compiled. At the same time, it will slows down the performance it the source data is huge.
Since I cannot put logic to user-defined TRANSFORMS, I've created new transform which call routines from the drop down DSRoutines.
If there are any changes to the routines, do I still need to recompile my dsjobs?
Jobs do not need to be recompiled if Routines change. Routines are stand-alone components, which are compiled separately.
Jobs DO need to be recompiled if Transforms change. Transforms are encapsulated expressions which become part of the in-line job code when used. Transforms are not compiled separately.
Note the difference between a Transform (which is in the Transforms branch of the Repository, and is not compiled separately) and a transform function (which is one kind of Routine, and is stored in the Routines branch of the Repository, and which is compiled separately).
Incidentally, your code has re-invented the Abs() function to return the absolute value of a number.
That would mean I'm facing a big problem here.
Is there any commands/ways to know what job calls particular transform?
For example, select from DS_JOBS, etc.
Else I need to trace 1000 datastage jobs to revert the changes.
Usage analysis is doing that for you. Go to the manager. Mark the transform/routine you are looking for. Klick right mouse button and choose "usage analysis". You will receive a the list of jobs using the specific transform/routine.