Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Flat File Index (Very Urgent)

 
Ayyappa Iyer
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Matts Smith
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic