Jeremy
Jeremy

Reputation: 6670

COBOL Copybook Specifications for a C# programmer

I am working on an application that requires me to produce a COBOL copybook to define a data file.

Does anyone have a good reference on how to write out a copybook?

Upvotes: 5

Views: 4579

Answers (2)

Abacus
Abacus

Reputation: 2119

First to clarify, I presume you are not asking for the syntax, which is just lines of COBOL code from either the DATA DIVISION or PROCEDURE DIVISION.

So what is the way to format a file layout? You need to recognize that this is very low-level data modeling. So you need to really understand what your data looks like. You can research various data modeling methodologies, but I suggest starting with what you know. If you know how to model a database table, design it like you would the table. Then convert to the file format.

This will probably highlight that you have multiple entities to model. Then you might decide that you really need multiple files, or you might be able to get away with combining a couple records into a long file (flattening) or create "auxiliary" records using REDEFINES and some kind of variance key to tell you which type of data is in this record.

Upvotes: 0

Charlie Martin
Charlie Martin

Reputation: 112406

A "copybook" is basically COBOL speak for an include file. You need to write a description of your data in COBOL format. Here's a tutorial. Here's some other good articles.

Upvotes: 4

Related Questions