×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

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!

*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

COBOL General discussion FAQ

Data Structure

What are COBOL Files and COBOL Data Types? by StephenJSpiro
Posted: 19 Jan 02

There are no such things as COBOL files and COBOL data types.

COBOL is, far and away, the most versatile high level language in the computer industry.  From the beginning, COBOL was designed to be flexible in handling all manner of file structures and data structures.  

Data types and file organization is determined by vendors to operate on particular hardware and operating system architectures.   COBOL is designed to process these formats.

HIDAM databases (such as IMS) came with their own Application Programming Interfaces (APIs), so "native" COBOL syntax was never developed.  Relational databases came with SQL from the beginning, so "native" COBOL syntax was never developed.  The CODASYL Journal of Development had some syntax for new datatypes, but it has not been adopted because a commercial need has never developed.

COBOL syntax handles sequential, relative, and indexed files natively.  "Line Sequential" should have been added to the standard, but all COBOL compilers which run on systems which use it, have it as an extension.

There was a great deal of effort to expand the new COBOL standard to handle many more datatypes than previously.  Incomprehensibly, 3 data types were omitted, and they must be processed in COBOL using kludges:  (SQL types VARCHAR and VARCHAR-LONG, as well as field-mark deleimited data types).  Nevertheless, COBOL remains the most flexible high-level language in the industry.

A note: the format of PACKED-DECIMAL is not specified in the COBOL standard. Its internal representation varies from computer-maker to computer-maker.  Not only is the internal representation different, the Syntax is not standard, either.  Some call it COMP-3, others COMP-2 or anything else. ALL COMP-x data types are IMPLEMENTOR-DEFINED. They are ALL extensions to the standard.  

Programmers using state-of-the-art whiz-bang computer-science leading-edge languages frequently need to access files and/or data types originally created by COBOL programs, and find that their state-of-the-art whiz-bang computer-science leading-edge languages are totally inadequate to handle anything except some subset of their systems capabilities.  ERRONEOUSLY, they blame this on COBOL, rather than the inadequate state-of-the-art whiz-bang computer-science leading-edge tools which they are using.

Stephen J Spiro
Member, ANSI COBOL Standards Committee

Back to COBOL General discussion FAQ Index
Back to COBOL General discussion Forum


My Archive

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