How to get Hashed File row count?

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
arijit
Participant
Posts: 2
Joined: Wed Nov 22, 2006 11:09 pm
Location: India
Contact:

How to get Hashed File row count?

Post by arijit »

Hi,

Is it possible that the total number of rows inside a Hashed file NOT equal to the total number of rows mentioned in the input link to the same Hashed file?

If so when and also how to get total number of rows inside a Hashed File.

Thank You,
Arijit.
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post by nick.bond »

That is definately possible, you could write 4 million records into the hashed file, and if all the key values were the same the job would report 4 million records on that link (which is correct) but the hashed file would be left with one one record as it overwrites based on the hashed file key.

If the hashed file has been created under the account, or if a pointer has been created for it you can run SQL against it to get the count of records in the hashed file.
Regards,

Nick.
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post by rafik2k »

Yes, it's possible that the total number of rows inside a Hashed file NOT equal to the total number of rows mentioned in the input link to the same Hashed file.
Check log file to know actual total no. of rows loaded into a Hash File.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Any job log will only show how many records were written to a hashed file, not what it ended up containing. :?

As noted, a hashed file with a VOC pointer can be counted with normal sql or with EXECUTE COUNT RETURNING. Or build a brain dead job that sources from the hashed file to a sequential file but with an @FALSE constraint in the Transformer stage between the two. The number of records read can then be observed when the job runs.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Or go inside your Administrator and simply type the command

Code: Select all

COUNT hashedfilename
If the hashed file is a pathed hashed file, then create a VOC entry using SETFILE command and use that VOC name as the hashed file name.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
arijit
Participant
Posts: 2
Joined: Wed Nov 22, 2006 11:09 pm
Location: India
Contact:

Hashed File problem.

Post by arijit »

DSguru2B wrote:Or go inside your Administrator and simply type the command

Code: Select all

COUNT hashedfilename
If the hashed file is a pathed hashed file, then create a VOC entry using SETFILE command and use that VOC name as the hashed file name.
Thank you very much. I had a problem in which I had to get the changed rows using CRC logic. I tried to load the all data(CRC coded) into the hashed file during first run and lookup the same hashed file in the second run. But the hashed file seems to miss some rows even if there are no duplicate rows at source.
-AB.
sun rays
Charter Member
Charter Member
Posts: 57
Joined: Wed Jun 08, 2005 3:35 pm
Location: Denver, CO

Re: Hashed File problem.

Post by sun rays »

Check if both your source and hashed file have the same set of keys.
Post Reply