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!

Multiple Field Alternate Index

Status
Not open for further replies.

klophockey

Programmer
May 25, 2016
41
US
I have been looking for a good example of a Cobol program which a File Control statement with a primary key (index) and an alternate key (index).

I would greatly appreciate having an example of one because I think my syntax can't be right. Thanking you advance for taking time to help me.

When it tries to open the file as Input. I get a file status 39.
I know the primary key data name is right and so are the alternate key fields.
I am not sure I have coded correctly the statement of: ALTERNATE RECORD KEY IS FILDAT-IXD=FILDAT-TIMESTAMP,
FILDAT-DATE

Here is File Control statement I have coded.

FILE-CONTROL.
SELECT FILDAT ASSIGN TO VAR
ORGANIZATION IS INDEXED
ACCESS IS DYNAMIC
RECORD KEY FILDAT-KEYP
ALTERNATE RECORD KEY IS FILDAT-IDX= FILDAT-TIMESTAMP,
FILDAT-DATE
LOCK MODE IS MANUAL
WITH LOCK ON MULTIPLE RECORDS
FILE STATUS IS STATCHK.


 
I might add that FILDAT-TIMESTAMP and FILDAT-DATE are not fields which are next to one another in the file.
In addition, I am running this in Miro Focus Cobol
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top