View Data not showing last record in Hash file

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
tonystark622
Premium Member
Premium Member
Posts: 483
Joined: Thu Jun 12, 2003 4:47 pm
Location: St. Louis, Missouri USA

View Data not showing last record in Hash file

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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
tonystark622
Premium Member
Premium Member
Posts: 483
Joined: Thu Jun 12, 2003 4:47 pm
Location: St. Louis, Missouri USA

Post 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
datastagedummy
Participant
Posts: 56
Joined: Thu Feb 13, 2003 6:08 pm
Location: USA

Post 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.
tonystark622
Premium Member
Premium Member
Posts: 483
Joined: Thu Jun 12, 2003 4:47 pm
Location: St. Louis, Missouri USA

Post by tonystark622 »

I physically deleted all the files and directories associated with the hash files and recreated them. Still acts the same.

Tony
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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
Post Reply