Read DSX to identify DB stages which write to 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
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Read DSX to identify DB stages which write to hashed files

Post by clarcombe »

I have been looking at the DSX file in order to find out which jobs write to hashed files. This is part of a bigger process to move the hashed file creation to an overnight batch to reduce processing times.

In the section

Code: Select all

OLEType "CContainerView"
I can identify stage identifiers by

Code: Select all

StageList "V0S33|V51S0|...
and then their corresponding types by

Code: Select all

StageTypes "ID_PALETTEANNOTATION|ID_PALETTEJOBANNOTATION....
Then I can link the IDs to the Types and identify the Oracle stages by the CCustomStage tag and the hashed files by CHashedfileStage.

I then have to read through the DSX and find the hashed file

Code: Select all

Partner 
tag to see if it is linked to the

Code: Select all

CCustomstage
tag.

This seems all very longwinded (and not very reliable) and I wondered if there was a simpler way to do this ?

Any ideas ?

Thanks
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

How about just searching the repository from the director for jobs that use the hashed file stage, or do you only want to locate writes?

In that case I would write a small BASIC program to traverse all jobs in a project looking for the specific stage - and I believe you can use the link information for the stage to determine if it is a source, reference or target stage.
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

When you say search Director, are you thinking of 8.x because I only have 7.X and no search capabilities.

Its not so much the HF stage but more ODBC-> HF or ORA->HF that I am concerned about. Given that there are several hundred jobs, I really need to identify just those types.
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

My fault, I meant "Designer" not "Director" but my fingers disobeyed me.

From what you state, that search result won't help, you need to write BASIC job to

Code: Select all

FOR {all jobs in project}
   open job
   SELECT all passive stages
   FOR {all stages}
      IF Hashed file stage type 
      THEN
         SELECT all links for stage
         IF {no outgoing links, just input link}
         THEN
            PRINT 'We have a Winner!'
         END
      END
   NEXT stage
NEXT job
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

Without wanting you to write this, I don't know the syntax to interrogate the underlying Uniserv tables to get this information, hence my method of reading the DSX files.

1) Where can I get hold of this ?
2) Is it safe to interrogate the Uniserv tables this way ?

Thanks
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes, it is perfectly safe to 'interrogate' (as in read) the legacy repository like that. Now, if you want to stick to the dsx method I would suggest something I used to great effect in the past. Chuck Smith has a variety of DataStage tools many of which parse a dsx export into something easily pushed into a relational target.

Specifically it was the "List all files and tables used by jobs in a dsx file" code that I modified to write to a database table so that it was accessible from SQL. From what I recall it should easily let you find jobs with target hashed files and database sources.
-craig

"You can never have too many knives" -- Logan Nine Fingers
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

Excellent. Thanks Craig
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
Post Reply