Page 1 of 1

View Data not showing last record in Hash file

Posted: Wed May 21, 2003 8:42 am
by tonystark622
I'm using DataStage v6.0.1.5, on HP/UX.

In Designer, when I look at this one hash file in this job (View Data), I only see the first 8 out of 9 records in the hash. When I read from the hash file and write the data to a flat file, I get all the data in the flat file, but if I press the View Data button on the Sequential file stage, it only shows me the first 8 records.

This smells like a bug to me, but I can't imagine something like this getting past QA, so I figure I must be doing something wrong. Can anybody give me a hint what I've missed?

Thanks!
Tony

Posted: Wed May 21, 2003 10:19 am
by chulett
All this behaviour from the same job - the viewing and the running? If that's the case then I smell bug, too.

-craig

Posted: Wed May 21, 2003 10:39 am
by tonystark622
It happens both in the same job and in a new job that I created that just had a hash file stage and a sequential file stage. Read the rows from the hash file and wrote to a flat file. Looking at the data in both hash file and flat file within DataStage showed all but the last record. Looking at the flat file through Unix showed all the records.

Weird.

Tony

Posted: Wed May 21, 2003 12:54 pm
by datastagedummy
I have had some similar problems when I changed the keys in a hash file but re-creating the file solved my problem.

Posted: Thu May 22, 2003 6:58 am
by tonystark622
I physically deleted all the files and directories associated with the hash files and recreated them. Still acts the same.

Tony

Posted: Thu May 22, 2003 7:03 pm
by ray.wurlod
Smells like a bug to me too, probably stemming from a quite common error in DataStage BASIC programming.

Select filevariable
EndOfData = @False
Loop
ReadNext key Else EndOfData = @True
While Not(EndOfData)
* read and display row for that key
Repeat

This misses the last row because the exit from the loop is in the wrong place in the loop. If the data browser for hashed files has been written in this way it would explain why the last row is missed.



Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518