• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Flat File Index (Very Urgent)

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic