×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Record and File Description in Cobol

Record and File Description in Cobol

Record and File Description in Cobol

(OP)
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
 

RE: Record and File Description in Cobol

What is the problem ????

RE: Record and File Description in Cobol

(OP)
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.

RE: Record and File Description in Cobol

What is saying your compiler ?

RE: Record and File Description in Cobol

(OP)
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

RE: Record and File Description in Cobol

For me you don't have any problem.

RE: Record and File Description in Cobol

(OP)
Ok, thx

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close