Page 1 of 2

Getting Row count for all hash files in a category

Posted: Thu Jun 09, 2005 11:10 pm
by Andal
I want to know how to get rowcount for all the hash files in a prticular category or in a project.

For getting rowcount for a single Hashfile we are using

"Select Count(*) from HashFileName", is there some thing like this to get the count for all the Hashfiles used in a category.

Rgds
Andal.

Posted: Fri Jun 10, 2005 12:30 am
by ArndW
Hello Andal,

there probably is, but you need to add the selection of the category to your query. How do you differentiate your "Categories"? Is it by location? By file name?

Posted: Fri Jun 10, 2005 12:45 am
by ray.wurlod
There isn't.

You could create a job sequence to identify the hashed files then run a job to count the records in each, appending the results to a file or inserting into a database.

Do you want to include all the hashed files that make up the repository?

Is there a standard location for your hashed files? That would affect the mechanism you choose for identifying the hashed files.

Posted: Fri Jun 10, 2005 1:17 am
by Andal
My hash files are in the same folder where my project lies, we will categorize the hash files by functional wise, ex for Finance related jobs we will be having a category like Finance_Intial_Load, and for purchase we are having Purchase_intial_Load.

I am having the list of hash files used in each category , but how can i use them as a parameter and loop the job.

Posted: Fri Jun 10, 2005 1:41 am
by ArndW
Andal,

if you have a list of files then you can use the loop construct within a sequence job and iterate through the list call up your counting job for each Hash file object.

Posted: Fri Jun 10, 2005 6:22 pm
by kduke

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
;

Code: Select all

select 
   CATEGORY, 
   COUNT(*)
from 
   DS_JOBOBJECTS, 
   DS_JOBS
where 
   DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') 
   and EVAL DS_JOBOBJECTS."@RECORD<6>" <> ''
   and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO 
group by 
   CATEGORY
;

Posted: Sun Jun 12, 2005 10:34 pm
by Andal
Hi All

Thanks for ur suggestions, The query given by Kim returns me entire rowcount of a category which doesnt satisfy my requirement.

So i looped a sequence and passed the Hashfile name as a input to my server job, and i got my required output. Thanks for all for spending ur valuable time.

Rgds
Andal

Posted: Thu Jan 19, 2006 5:15 pm
by Titto
Can you post the code please

Posted: Thu Jan 19, 2006 11:33 pm
by Andal
Titto wrote:Can you post the code please
The query given by kim will return all the Hash file names.Loop it and then use

Code: Select all

SELECT Count(*), '#HashName#' FROM #HashName#;
and write it to a Sequential file.

My approach at that time was different. any how if you want the code, tell me ur mail id. I will send u the dsx.

i too need

Posted: Fri Jan 20, 2006 1:02 am
by kkreddy
hi Andal
i too need the code , could u plz send it to kkreddy29@gmail.com

thanks and regards
Kiran Kumar

Posted: Fri Jan 20, 2006 3:23 pm
by Titto
Andal wrote:
Titto wrote:Can you post the code please
The query given by kim will return all the Hash file names.Loop it and then use

Code: Select all

SELECT Count(*), '#HashName#' FROM #HashName#;
and write it to a Sequential file.

My approach at that time was different. any how if you want the code, tell me ur mail id. I will send u the dsx.
Please send it to raj_titto@yahoo.com
Thanks

Posted: Sat Jan 21, 2006 11:27 am
by kduke
Post it. We helped you then help others by posting the solution.

Posted: Mon Jan 23, 2006 1:16 am
by Andal
I had sent the DSX to the mentioned id's, or is there any site so that we can share our files. I will upload my DSX to the site so that everyone can access.

Anyhow this was written when i am new to DS, but now there are better ways to do it.

Posted: Mon Jan 23, 2006 6:42 am
by kduke
It is all job control code correct? If so then post that. You could post the DSX on ADN (Ascential Developer Net).

Posted: Mon Jan 23, 2006 7:58 pm
by ray.wurlod
:idea: You can even post the job control code here, surrounded by Code tags.