Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Indexed Files

Status
Not open for further replies.

carolly

Programmer
Aug 2, 2001
27
AU
I am using an indexed file for a program and the data is set up exactly the same in both but I get an error message of 1035-E Key is not wholly contained within minmum record length. This is the 4th program that is using this inded file and the other 3 are fine. Any ideas?
 
You may have an 01 level data description for this file which is not accurate.
 
what are the rules for index keys - must they all be 01 level data descriptions? I have set them as follows:

01 I-ID-DT.
05 I-ID PIC X(04).
O5 I-DATE PIC 9(06).
05 I-TIME PIC 9(04).
01 R-DATE PIC 9(06).
01 R-TIME PIC 9(04).

THE key is I-ID-DT
 
That appears to be OK - but what is the record key specified in the SELECT statement? Something must be different if one program works and another does not. Which COBOL compiler are you using on what platform?
 
Hi,

Suppose you were a compiler. You were told to store 3 types of records with a primairy key which is only defined inside one of the records. And also: that primairy key is longer than even those other records. How do you - being the compiler - manage this?

Being a compiler I would give some message....

suppose you make an other record, combining the fields you want to associate to that key:
Code:
      01 MY-RECORD.
          03  I-ID-DT.
              05 I-ID   PIC X(04).
              O5 I-DATE PIC 9(06).
              05 I-TIME PIC 9(04).
          03  R-DATE    PIC 9(06).
          03  R-TIME    PIC 9(04).

I hope this is helpful.

Regards,

Crox
 
Maybe it has an alternate key and you are using the primary key. If you do not like my post feel free to point out your opinion or my errors.
 
I found the problem that I was having was that I opened the user-file I-O and this was causing problems so I used the two files open for input and another file open for output. Is there some way around that I can open the file for I-O without getting that error message. what is the best way to post the code to here?
 
Hi,

an example of source is in an other thread...

Regards,

Crox
 
To use I/O on a keyed file, I think access has to be "DYNAMIC".

What does your Access clause say in your select statement?

The key on all of the records must be the same, or you can not access it randomly. However if the key is closer to a set of records you can use random to get the first in a series of records and use read next until you find the right one.

For instance if a key was a SSN and a record type and one record had an additional key field, it might be possible to describe an alternate key to include the additional field. Or just build a new file and use that. If you do not like my post feel free to point out your opinion or my errors.
 
Thanks for that, I just had it set up the wrong way. I was using the Dynamic access as I needed to read sequentially and randomly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top