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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record and File Description in Cobol

Status
Not open for further replies.

Jri123

Programmer
Dec 20, 2008
4
BE
Hello,

I have a question about the record and file description in Cobol.

This is my code:

--File description--

SELECT OPTIONAL boek-file ASSIGN TO "boek.dat"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS boek-prim-key
ALTERNATE RECORD KEY IS boek-alt-key1 WITH DUPLICATES
ALTERNATE RECORD KEY IS boek-alt-key2 WITH DUPLICATES
FILE STATUS IS boek-status.

and
--Record description--

FD boek-file.
01 boek-record.
03 boek-key.
05 boek-prim-key.
07 b-bnr PIC 9(4).
05 boek-alt-key1.
07 b-buitgever PIC X(25).
05 boek-alt-key2.
07 b-btitel PIC X(25).
03 boek-data.
05 b-publicatieJaar PIC 9(4).

I wonder if its correct to write boek-alt-key1 and boek-alt-key2 as 2 seperate groupfields. I'm not sure that this is allowed, i'm guessing it is but I wanna make sure.

Kind regards
 
In the record description...

05 boek-alt-key1.
07 b-buitgever PIC X(25).
05 boek-alt-key2.
07 b-btitel PIC X(25).

If its allowed to write it down like that, using 2 alternate keys with each an individual groupfield.
 
Well, my compiler doesn't indicate any errors, but i'm not writing a full program, only parts of it so I can't really test it.

I just want to make sure its allowed to write it down like that..

Kind regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top