Occurs clause, COBOL Programming

Assignment Help:

Occurs Clause:

Let us establish tables with the help of an illustration. Assume that there are ten different types of income-tax rates that are read from some input medium and these rates are stored in a table named INCOME-TAX-RATE. The DATA DIVISION entries for this table may be as

As shown below:

219_Occurs Clause.png

Clearly, there are ten different data names, like TAX-RATE-1, TAX-RATE-2 etc., in the table namely the INCOME-TAX-RATE and each of these items is of two digits. As the picture of all these items are similar, these can be explained by having just one entry and then specifying that the explanation is to be repeated ten times. This is completed as shown below:

01              INCOME-TAX-RATE

02  TAX-RATE    PIC  99  OCCURS  10  TIMES.

This OCCURS clause specifies that the table named INCOME-TAX-RATE is having ten elements and each one is of two digits. In order to refer to an individual element exclusively we should use a subscript. The initial element is referred to as TAX-RATE (1), the second one as TAX-RATE (2), the seventh one as TAX-RATE (7), and so on. TAX-RATE (1), TAX-RATE (2) etc., are termed as subscripted data names and 1, 2 etc., that are enclosed in parentheses and are known as subscripts.

The common format of OCCURS clause is as shown below:

  {OC}            integer        TIMES

  {OCCURS}


Related Discussions:- Occurs clause

Simple sort verb, THE SIMPLE SORT VERB: The process of sequencing the ...

THE SIMPLE SORT VERB: The process of sequencing the records in some preferred manner is termed as sorting. The Sorting is done upon some key data item in the record. For illus

Example of condition names, Example of condition names: The illustrati...

Example of condition names: The illustration below is of the use of the condition names  77  MARITAL-STATUS     PIC    9   88  SINGLE    VALUE    IS     ZERO   88  MA

Rules for indexed tables, RULES FOR INDEXED TABLES: The rules of index...

RULES FOR INDEXED TABLES: The rules of indexing a table with an INDEXED phrase are as shown below: (1) If indexing is completed for any one level of a table, then indexing

Illustration of multiply verb, Illustration of Multiply verb: (a)  MUL...

Illustration of Multiply verb: (a)  MULTIPLY A BY B. In this situation the value of A & B will be multiplied and the product will be stored in B.  The decimal point locatio

Move verb - cobol programming, Introduction to MOVE Verb: The aim of th...

Introduction to MOVE Verb: The aim of this section is to introduce the learner how to move data from one place to the other place in the memory. This is completed with the help

Illustration of divide verb, Illustration of Divide verb: (a) DIVIDE 5...

Illustration of Divide verb: (a) DIVIDE 5 INTO A. If the value of A is 20, then after execution of this statement the value of A will be 4. The older value of A will be los

Program for inventory , PROGRAM FOR INVENTORY  We have to write a progr...

PROGRAM FOR INVENTORY  We have to write a program to update the inventory file. Consider 2 files,viz, invfile an tranfile. Invfile has 3 fields pno,name,qty. Tranfile has 3 fil

Rewrite statement - indexed files, REWRITE STATEMENT: As in the situat...

REWRITE STATEMENT: As in the situation of a relative file, the REWRITE statement needs that the file should be opened in the I-O mode, and if the SEQENTIAL access mode is spec

File updation, FILE UPDATION: The method of modifying an old file with...

FILE UPDATION: The method of modifying an old file with present information is termed as file updating. Master file: A master file is a file which is used as an author

Rules of renames clause, RULES OF RENAMES CLAUSE:   The rules below s...

RULES OF RENAMES CLAUSE:   The rules below should be observed while using the RENAMES clause: (i) All RENAMES entries should be written only after the last record descript

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd