It's not a secret anymore!*
The moose likes Java in General and the fly likes Flat File Index (Very Urgent) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Flat File Index (Very Urgent)" Watch "Flat File Index (Very Urgent)" New topic
Author

Flat File Index (Very Urgent)

Ayyappa Iyer
Greenhorn

Joined: Sep 14, 2001
Posts: 3
I have a MVS Dataset named A.1 whose record length is 30 and the data containing reads as 3065 511111 012. I need to write to a flat file with the following structure
3065 - (ID) 4 chars
511111 - (AMT) 6 digits
012 - (VAL) 3 digits
How do I do the index in the order of ID, AMT and VAL.

Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
OK, I am confused. flat files do not have an index.
Are you perhaps asking how to SORT the file by ID, AMT and VAL?
In which case you should look at the Collections.sort(List l) method.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Matts Smith
Ranch Hand

Joined: Feb 03, 2001
Posts: 113
the easiest implementation if the file is read only is to build the index files when you create the flat file. if it's read/write then it's something you don't want to code yourself. get a flat file library. I don't know any myself.
the index file contains the column indexed (sorted) and it's index (position) in the flat file.
If this does not make any sense to you then I'm sorry, just read documentation on ISAM. Otherwise enjoy.
Ayyappa Iyer
Greenhorn

Joined: Sep 14, 2001
Posts: 3
Let me clear what exactly I want
I have a MVS Dataset named A.1 whose record length is 30 and the data containing reads as 3065 511111 012. I need to write to a flat file with the following structure
3065 - (ID) 4 chars
511111 - (AMT) 6 digits
012 - (VAL) 3 digits
If I had to insert into a table I can easily insert the values and create a primary key or a index for the above fields.
How do I achieve this same functionality if I have to use the flat file (index in the order of ID, AMT and VAL)
I hope I'm clear.
Any thougths and suggestions .
Very Urgent!!
Laurent Leonard
Ranch Hand

Joined: May 15, 2001
Posts: 35
The way you explain your problem makes me quite confused because you come with a solution and not with a problem.
My question is :
WHAT do you want to do and not HOW do you want to do ? Maybe when you'll explain that we can help you.
Do you want to have quick access to data ?
Do you want to sort the data ?
------------------
Laurent Leonard
Laurent.Leonard@advalvas.be
[This message has been edited by Laurent Leonard (edited September 19, 2001).]


Laurent LEONARD
 
Don't get me started about those stupid light bulbs.
 
subject: Flat File Index (Very Urgent)
 
Similar Threads
"Start: Applet is not initialized" error when accessing applet file through web browser
Flat File Index (Very Urgent)
While loop question from SCJP 5.0
Read text values in javascript
Help required in Dates/ SimpleDateFormat