To identify whch job uses the corresponding hashed files.

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
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

To identify whch job uses the corresponding hashed files.

Post by satheesh_color »

Hi All,

We have a set of hashed files, we will need to identify which hashed files is used by the job.

The reason is we have around 2000 jobs.So we need to find out which job uses the corresponding hashed file as a lookup.


Please let me know your thoughts.


Thanks,
Satheesh.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Chuck Smith publishes a free 'tool' on his website that would help with this. A search here for OLETYPE might turn up a query you could modify to do this as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Re: To identify whch job uses the corresponding hashed files

Post by PhilHibbs »

I just wrote this (got it right first time! from memory!):

Code: Select all

perl -ne "$j=$_ if /^   Identifier/; if (/^ +Name/){$n2=$n1;$n1=$_} print $j.$n2.$n1 if /FileName .FILE_NAME_HERE./"<dsx_file_name.dsx
needs Perl of course.

Insert your hashed file name in between the dots, and your dsx file name after the <. It will print out the job name, stage name, and link name of the Hashed File stage. There may be some circumstances under which it prints the wrong stage name, but this is very unusual.
Last edited by PhilHibbs on Mon Aug 24, 2009 6:14 am, edited 1 time in total.
Phil Hibbs | Capgemini
Technical Consultant
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or that. :wink:

Thanks Phil, I'll have to give that a go later on a spare dsx I have hanging around.
-craig

"You can never have too many knives" -- Logan Nine Fingers
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Post by PhilHibbs »

chulett wrote:I'll have to give that a go later on a spare dsx I have hanging around.
Just fixed a bug, so I was mistaken about "right first time". Also it will get the Stage Name wrong if there are multiple links to the stage.

*Update*:

Code: Select all

perl -ne "$j=$_ if /^   Identifier/; $o=/CHashedFileStage/ if /^ +OLEType/; $on = $_ if $o and /^ +Name/; $n = $_
 if /^ +Name/; print $j.$on.$n if /FileName .FILE_NAME_HERE./"<dsx_file_name.dsx
Phil Hibbs | Capgemini
Technical Consultant
Post Reply