DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
ds_ashish
Participant



Joined: 23 Nov 2006
Posts: 15

Points: 113

Post Posted: Mon Mar 10, 2008 12:38 am Reply with quote    Back to top    

DataStage® Release: 7x
Job Type: Server
OS: Unix
Hi All,

I want to find out a perticular routine say 'abc' is used by how many number of datasage job in a project.

for e.g.
Job Name Routine_Name
Job1 abc
Job2 xyz
Job3 abc
Job4 abc
Job5 xyz

Desired Output : Job1,Job3 and job4 using routine 'abc'

Thanks in Adv.
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54601
Location: Sydney, Australia
Points: 296091

Post Posted: Mon Mar 10, 2008 12:42 am Reply with quote    Back to top    

It can be done, but not directly. Routines may be called from jobs (as before/after subroutines or as job control routines) or from Transformer stages (as transform functions) or from any active stag ...

_________________
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rate this response:  
Not yet rated
baglasumit21
Participant



Joined: 01 Mar 2006
Posts: 132
Location: Pune
Points: 924

Post Posted: Mon Mar 10, 2008 1:38 am Reply with quote    Back to top    

ds_ashish wrote:
Hi All,

I want to find out a perticular routine say 'abc' is used by how many number of datasage job in a project.

for e.g.
Job Name Routine_Name
Job1 abc
Job2 xyz
Job3 abc
Job4 abc
Job5 xyz

Desired Output : Job1,Job3 and job4 using routine 'abc'

Thanks in Adv.


Hi Ashish,
If you want to just check how many jobs are using a particular routine then this can be done through DS manager. Just select the routine you want to check the usage for and then Right click and click 'Usage Analysis". It will give you the list of jobs along with other details about where that particular routine is used

_________________
SMB
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54601
Location: Sydney, Australia
Points: 296091

Post Posted: Mon Mar 10, 2008 1:59 am Reply with quote    Back to top    

Usage Analysis does not pick up job control routines, nor does it pick up routines invoked by other routines unless their Dependencies tab has had the dependent routines inserted in its grid. Nor - I ...

_________________
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 43085
Location: Denver, CO
Points: 222463

Post Posted: Mon Mar 10, 2008 7:34 am Reply with quote    Back to top    

Rather than the complex query, you could go old school and use your editor of choice to find all occurances. You need to go 'up' from each one to find the 'BEGINJOB' record so you'd know where you'd f ...

_________________
-craig

"You can never have too many knives" -- Logan Nine Fingers
Rate this response:  
Not yet rated
gateleys



Group memberships:
Premium Members

Joined: 08 Aug 2005
Posts: 992
Location: USA
Points: 7244

Post Posted: Mon Mar 10, 2008 1:17 pm Reply with quote    Back to top    

A simple(?) solution will be to have a job which reads the dsx file as a single column, parses it in a Transformer and outputs the JobNames that use the Routine. The pRoutineName is passed as a job parameter. We will use a group of stage variables (as opposed to a routine) to get the jobs.

Code:

Stage Variables
-------------------
svRoutineName = UPCASE(TRIM(pRoutineName))
svInputCol    = UPCASE(TRIM(InputLink.DSXColumn))
svJobName     = If RowProcGetPreviousValue(svInputCol)  = "BEGIN DSJOB" Then FIELD(svInputCol, '"', 2) Else svJobName
svRoutineFound= If Index(svInputCol, svRoutineName, 1) > 0 Then @TRUE Else @FALSE


Now, in the Transformer output link, use the constraint -
Code:

svRoutineFound


Also, in the Transformer output link, define a column called JOBNAME and set its derivation to the stage variable svJobName, that is -
Code:

JOBNAME = svJobName


Let the output flow to a hashed file, with JOBNAME set as key. This will eliminate duplicate job name when the routine is used multiple times in the same job.

There you go. That should give you the names of all jobs that use the Routine name (or any string) that is passed as a job parameter.

NOTE: If the Routine Name is any common string that could occur as part of anything in the job, then you will get even those jobs that do NOT contain the Routine.

If you really want to make sure that they are not any literals in a job, but are actually routines, then you will have to parse the dsx for every type of situations where a routine can be invoked (as mentioned above - before/after jobs, before/after active stages, job control, derivations, constraints). You will have to look for occurrences of the following strings -

1. "BeforeSubr" (followed by a string pattern containing the routine name)
2. "AfterSubr" (followed by a string pattern containing the routine name)
3. "Transform" (followed by a string pattern containing the routine name)
etc ..

Similarly, you can check for job control and Constraints (that contain routines).

_________________
gateleys
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54601
Location: Sydney, Australia
Points: 296091

Post Posted: Mon Mar 10, 2008 3:48 pm Reply with quote    Back to top    

Job control routines don't have names. However, in a DSX or XML export file they do have property names.

_________________
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours