Data is not in order in Hash file.
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 78
- Joined: Fri Mar 02, 2007 4:54 am
- Location: CHENNAI
Data is not in order in Hash file.
I'm extracting data from .csv file and putting it into a hash file.
I'm just doing direct mapping.I've input key column values as 1 to 100.
But in output the value of key column are not in the same order as that of input.
Pls help me out..
Thanks in advance
I'm just doing direct mapping.I've input key column values as 1 to 100.
But in output the value of key column are not in the same order as that of input.
Pls help me out..
Thanks in advance
... based on a hashing algorithm, hence the name. Now, if you want sorted output you can:
1. Create the hashed file in an account or create a VOC record for it if pathed
2. Create an index over the desired field (may be optional but certainly recommended)
3. Use a UV stage to access the hashed file via SQL and specify an 'ORDER BY' clause.
There's also the SSELECT verb in BASIC but that's for hand coders.
1. Create the hashed file in an account or create a VOC record for it if pathed
2. Create an index over the desired field (may be optional but certainly recommended)
3. Use a UV stage to access the hashed file via SQL and specify an 'ORDER BY' clause.
There's also the SSELECT verb in BASIC but that's for hand coders.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: Data is not in order in Hash file.
Actually it wont give it in sorted order.It ll be workin based on the key n if u particularly wan in sorted order den u shud use sort stage.
Thanks,
veera
Thanks,
veera
If you do need to pull out the data in an ORDER'ed manner, you could use the UV/ODBC stage and SQL ordering to pull out the data.
If you're really proficient with Universe, you could use the WITH section to add in Retrieve commands and use inline commands and field definitions to handle ordering. You just dummy the WITH using @ID to get past the hardcoded WITH statement and then add your BY or BY-DSND commands.
If you're really proficient with Universe, you could use the WITH section to add in Retrieve commands and use inline commands and field definitions to handle ordering. You just dummy the WITH using @ID to get past the hardcoded WITH statement and then add your BY or BY-DSND commands.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What you said about hashed files applies equally to all database tables. Physical storage is irrelevant to the user. This is a fundamental tenet of database design; it permits the engine to use an optimal storage strategy.
Hashed files are used by a number of different database products (such as UniVerse, UniData, D3, jBase and others) to implement their database tables.
In a Hashed File stage you can specify sorting criteria on the Selection tab if the stage is delivering a stream link. Simply put BY @ID as the phrase that governs selection by key.
Hashed files are used by a number of different database products (such as UniVerse, UniData, D3, jBase and others) to implement their database tables.
In a Hashed File stage you can specify sorting criteria on the Selection tab if the stage is delivering a stream link. Simply put BY @ID as the phrase that governs selection by key.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 132
- Joined: Wed Mar 01, 2006 11:12 pm
- Location: Pune
Re: Data is not in order in Hash file.
The hashed file stores the data based on hashing algorithm based on the key columns of your file. Its a type of indexed file.So when you insert the data it wont be in the same order as you have inserted. It is generally used for look-up so it wont matter what order the data is stored in the file. It wont affect the performance atall even if it is not sortedMOHAMMAD.ISSAQ wrote:I'm extracting data from .csv file and putting it into a hash file.
I'm just doing direct mapping.I've input key column values as 1 to 100.
But in output the value of key column are not in the same order as that of input.
Pls help me out..
Thanks in advance
SMB
-
- Participant
- Posts: 78
- Joined: Fri Mar 02, 2007 4:54 am
- Location: CHENNAI
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
No, that's a hashed file that you've defined.sachin1 wrote:A hash file can simply be described as a file that distributes data throughout a pre-sized and space allocated file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
No, that's a hashed file that you've defined.sachin1 wrote:A hash file can simply be described as a file that distributes data throughout a pre-sized and space allocated file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.