Command to know list of hash files in a particular project

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
shyju
Participant
Posts: 58
Joined: Thu May 19, 2005 1:00 am

Command to know list of hash files in a particular project

Post by shyju »

Hi All,

I would like to know whether there is any command or any other way to know the list of hash files and sequential files (at a strech) and also in which job they are created in a particular project?

Thanks,
Shyju.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

There is no direct to do this and ensure a correct list. Hashed files created in the project directory (and not in a remote path) are detectable, but hard to distinguish from the normal files used by DataStage. The builtin metadata and report generator can give some clue as to which files are used, but it relies on using the repositorie's table definitions in all the jobs. I've written some programs to read and parse an exported .dsx file to get file objects used, but that was a bit complicated as well - plus most file objects are not hard-coded but use parameters for their paths and thus even that method is not going to be 100% accurate.

You can use the UNIX "file" command and it's associated magic file to locate all hashed files on a system but you will need to process that list to remove all standard DataStage files. And that will located hashed files only, not sequential files.
Andal
Participant
Posts: 124
Joined: Thu Dec 02, 2004 6:24 am
Location: Bangalore, India

Post by Andal »

Hi Shyju,

You can use the search facility, to find out the Query. Kim Duke has posted lot of queries to do this. Else Chuck Smith has a tool, List All Files And Tables in DSX in his Website

Following is Kim's Query to list all the Hash files in the Project

Code: Select all


select 
   EVAL DS_JOBOBJECTS."@RECORD<6>" AS FILE_NAME FMT '35L', 
   DS_JOBS.NAME AS JOB_NAME FMT '35L', 
   DS_JOBOBJECTS.NAME AS LINK_NAME FMT '35L' 
from 
   DS_JOBOBJECTS, 
   DS_JOBS 
where 
   DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') 
   and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO 
group by 
   FILE_NAME, 
   JOB_NAME, 
   LINK_NAME 
; 
 

He has posted a similar query to list the Sequential files.

Code: Select all


select 
   EVAL DS_JOBOBJECTS."@RECORD<6>" AS FILE_NAME FMT '45L', 
   DS_JOBS.NAME AS JOB_NAME FMT '35L', 
   DS_JOBOBJECTS.NAME AS LINK_NAME FMT '35L' 
from 
   DS_JOBOBJECTS, 
   DS_JOBS 
where 
   DS_JOBOBJECTS.OLETYPE in ('CSeqOutput','CSeqInput') 
   and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO 
group by 
   FILE_NAME, 
   JOB_NAME, 
   LINK_NAME 
; 
 
You can combine these 2 queries like

Code: Select all

DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput','CSeqOutput','CSeqInput') 
Rgds
Anand
rkdatastage
Participant
Posts: 107
Joined: Wed Sep 29, 2004 10:15 am

Post by rkdatastage »

Thanks Andal

The querys are very useful

Thanks for your response

RK
Titto
Participant
Posts: 148
Joined: Tue Jun 21, 2005 7:49 am

Post by Titto »

Where do we run these SQL's if it is in Administrator, should it be in single line ?
shyju
Participant
Posts: 58
Joined: Thu May 19, 2005 1:00 am

Post by shyju »

Thanks andal... The information was very useful. I got the list of hash and sequential files by running the sqls in administrator in a single line.
Andal
Participant
Posts: 124
Joined: Thu Dec 02, 2004 6:24 am
Location: Bangalore, India

Post by Andal »

All the Credit goes to Kim Duke. You can run these sqls in Administrator or You can use this sql in Universe and redirect the output to Excel sheet.
Rgds
Anand
Post Reply