Page 1 of 1

Posted: Tue Mar 12, 2013 3:16 pm
by ray.wurlod
There are two possibilities. The first is that the source code was never imported into your project. In that case you will need to track down where the source code actually is. The second is that the code itself has been removed from your project.

Try a query against DS_ROUTINES to see whether your code actually exists.

If it does, the source code should be in field #15.

(I am assuming in all of this that the code is user-written, not part of the product. You might post the name of the routine so that we can be sure of that.)

Posted: Tue Mar 12, 2013 3:20 pm
by ray.wurlod
Actually there is a third possibility, that someone with UniVerse knowledge has cataloged the routine from some other location than DSU.BP. Once we know the name of the routine we may be able to explore this possibility too.

Posted: Tue Mar 12, 2013 3:28 pm
by joycerecacho
Hmmm... nice!!

Thanks, Ray.
Could you write me exactly the query I should run?
Thank you so much.

xxxx,

Posted: Tue Mar 12, 2013 3:29 pm
by joycerecacho
PS. the routine is not native, it's a user one.

Posted: Tue Mar 12, 2013 3:52 pm
by ray.wurlod
Query DS_ROUTINES on its key (DSRID). The following two queries give you an exact search or a search on partial name. Note that the routine name is case sensitive. (You can modify the queries to make this a case-insensitive search if desired.)

Code: Select all

SELECT DSRID FROM DS_ROUTINES WHERE DSRID = '<<RoutineName>>';

SELECT DSRID FROM DS_ROUTINES WHERE DSRID LIKE '%<<part of name>>%';
You might also look in VOC for a catalog entry. If it genuinely is a user-written routine, it should have a "DSU." prefix.

Code: Select all

SELECT F0 FMT '40L' FROM VOC WHERE "TYPE" = 'V' AND EVAL "UPCASE(F2)" LIKE '%<<PART OF NAME>>%';
All of these queries can be run from the DataStage Administrator client Command window for the project.

Posted: Tue Mar 12, 2013 4:12 pm
by sudha03_vpr
The routine should be present inside the Routines folder in the repository. And this looks to be a server routine and so for the routine to work, the Routine transforms also needs to present.

The routines are called inside the transform, which in turn is used in the Basic transformer stage.

Am not quite sure about your code though.

Posted: Tue Mar 12, 2013 4:58 pm
by ray.wurlod
sudha03_vpr wrote:The routine should be present inside the Routines folder in the repository. And this looks to be a server routine and so for the routine to work, the Routine transforms also needs to present.

The routines are called inside the transform, which in turn is used in the Basic transformer stage.
That information is not correct, and has not been correct since about version 2.2 (more than ten years ago).

Since that release, (also version 2.0.0 of routines) you can invoke routines directly from the Transformer stage. There is no need to encapsulate every routine in a Transform.

When DataStage first appeared (1997) this encapsulation was necessary because the Transform provided the argument passing mechanism to version 1.0.0 Routines. Version 2.0.0 routines have their own argument receiving mechanism.

Posted: Wed Mar 13, 2013 1:37 am
by zulfi123786
ray.wurlod wrote: and has not been correct since about version 2.2 (more than ten years ago).
I admire they way Ray has indexed the data so that it could be fetched after 10 years :D

Posted: Fri Mar 15, 2013 11:57 am
by rameshrr3
Usually I call routines directly in a transformer. Since I began with v 4.1 ( Ardent datastage) around 2001 - I dont think I ever needed to call routines from a transform. :)

For the OP's question , I think the routine could have been imported from another env without source code present . In such a case im not sure if any object stores it in UV with a hidden flag set.

Posted: Fri Mar 15, 2013 12:47 pm
by joycerecacho
Ray,
I run these queries you mentioned against VOC and DS_ROUTINES.
They returned one line but where is the routine code, which really interests me?

Thank you very much.

Posted: Fri Mar 15, 2013 3:33 pm
by rameshrr3
Can you log on to Xmeta and run this Query?
You post shows you are in version 8 or above :)

Code: Select all

select DSNameSpace_xmeta,moduleName_xmeta,SourceFlag_xmeta ,
 sourceCode_xmeta , subtype_xmeta 
from xmeta.DataStageX_xmetagen_DSRoutineXXXXXXXX
WHERE moduleName_xmeta = 'DSU.'.<YourRoutineName>and DSNameSpace_xmeta LIKE '%YourFULLProjectName%' 
XXXXXXXX = string suffix for your table name.

See if you can see any source code under the sourceCode_xmeta column. Also Check for the bit value of column SourceFlag_xmeta , a zero means you probably imported without source code :(

You can find the name of your xmeta routine table using a database explorer tool or quering a list of table names ( all_tables in oracle)

Posted: Fri Mar 15, 2013 3:47 pm
by ray.wurlod
If there is an entry for the routine in DS_ROUTINES the source code is stored in field #15 of that record.

The reason I wanted to see the VOC result was to confirm that it was a user-written routine (with "DSU." prefix) rather than some other kind. Because other kinds are not stored in DS_ROUTINES.