klophockey
Programmer
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 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.