Routine in Basic - its code does not appear!

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post by joycerecacho »

Hmmm... nice!!

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

xxxx,
Joyce A. Recacho
São Paulo/SP
Brazil
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post by joycerecacho »

PS. the routine is not native, it's a user one.
Joyce A. Recacho
São Paulo/SP
Brazil
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sudha03_vpr
Participant
Posts: 34
Joined: Tue Feb 26, 2013 9:36 am
Location: Chicago

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post 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
- Zulfi
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post 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.
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post 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.
Joyce A. Recacho
São Paulo/SP
Brazil
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post 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)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply