Working Storage Section

The working storage section contains instructions for updating variables in computer memory (such as adding two numbers together). Colloquially, variables are referred to as “data” and the instructions that change variables are considered to be “code”. COBOL provides several variable types: numeric, string, character and date. Numeric variables can store either whole numbers or floating point numbers (base 10 or base 14), while characters (including alphanumeric characters) can store only single values of a given character type. The type of data stored in each variable is specified on the first statement of its right-hand side:

  1. First line—the data type declaration for each variable. It defines the kind of data the variable will store.
  2. Second through fifth lines—the initial values for six position spaces (“AAAAA”) within the computer listing.
  3. Sixth line—the “page layout” statement, which describes how data look and how they’re arranged to be read.

Programming Construction in COBOL

COBOL is a compiled, imperative, procedural programming language designed for business use. It can handle very large numbers and strings. COBOL is still in use today because it’s robust, with an established code base supporting sprawling enterprise-wide programs. Learning to program in COBOL will set you up well for career prospects in fields like banking, insurance, investment management, and much more.

Similar Reads

Role of Programmer:

The COBOL program structure is very straightforward. It consists of the following components:...

Working Storage Section:

The working storage section contains instructions for updating variables in computer memory (such as adding two numbers together). Colloquially, variables are referred to as “data” and the instructions that change variables are considered to be “code”. COBOL provides several variable types: numeric, string, character and date. Numeric variables can store either whole numbers or floating point numbers (base 10 or base 14), while characters (including alphanumeric characters) can store only single values of a given character type. The type of data stored in each variable is specified on the first statement of its right-hand side:...

Types of Programming Construction in COBOL:

Sequence: A sequence is a series, an order in which the programmer can insert or delete records in a record set. In COBOL, an example of a sequence construction is using the INPUT statement to populate a file. Task: This is an abbreviation for A task that looks like: “SUBMIT QTY QM” The meaning of these words are as follows: SUBMIT = relay, TASK = procedure that is responsible for accomplishing some action as quickly as possible. In this case, it would be uploading product data to the system. The object name would probably be “PRODUCT”. Selective: “Selective construction” is a single statement, containing a single record, with an INCLUDE statement. A SELECT statement looks like:“SELECT FROM INCLUDE ” An example of selective construction is: “SELECT * FROM ORDERING VALUE WHERE VENDOR LIKE ‘%SOFTWARE%’ “An example of selecting records from a table would be: “SELECT * FROM PRODUCTS INCLUDE ORDERING VALUE”  Iterative: The loop is used to execute the same sequence of statements repetitively. An example of an iterative construction is: “PERFORM VARYING I FROM 1 BY 1 UNTIL I > 10 END-PERFORM” Data description: A description in COBOL is a data item that gives information about other data items. It has the form “DATA ”. It may be mandatory or optional. Data names are used for further reference i.e. adding/removing etc....

Contact Us