Example of redefines clause, COBOL Programming

Example of Redefines clause:

This illustration describes a sales record that may either contain the total amount of sale or the quantity (QTY) and UNIT-PRICE. The aim of such description may be to have two types of records and their types may be determined from the data item named SALES-TYPE. Based on some predetermined values of SALES-TYPE the record will be interpreted in one of the two forms, Note that the SALES-BY-UNIT and TOTAL-SALES refer to the similar storage space. They actually represent two different mappings of the similar storage region.

The REDEFINES clause as explained above is quite common in use. Though, the clause may be simply used for the aim of conservation of storage space possibly in the working-storage section. In such situations two records having no meaningful connection between them can also be used to share similar storage space provided both of them are not used in the program concurrently. The syntax of the REDEFINES clause is as shown below:

Level-number daa-name-1 REDEFINES data-name-2 

 

Posted Date: 10/17/2012 7:40:50 AM | Location : United States







Related Discussions:- Example of redefines clause, Assignment Help, Ask Question on Example of redefines clause, Get Answer, Expert's Help, Example of redefines clause Discussions

Write discussion on Example of redefines clause
Your posts are moderated
Related Questions
RULES FOR OCCURS CLAUSE: The rules apply for the OCCURS clause and the subscripts are as shown below. (1) The integer in the OCCURS clause should be a positive integer.

PROGRAM TO DEMONSTRATE MERGE VERB: The two files for which a record having 2 fields viz. Account Number and Name are already available. Now Merge these two files and create a

PICTURE specification: The size of a group item is equivalent to the total of the sizes of all the subordinate elementary items. The group item class is alphanumeric. The i

Illustration of nested if statement: Consider the nested sentence which is as shown below: The IF-ELSE pairs in this sentence can be detected by applying the rule whic

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

Example of If- else statement Illustration:   IF   QUANTITY IS NUMERIC AND QUANTITY IS POSITIVE          MOVE ZERO TO ERROR-CODE. COMPUTE SALES VALUE=QUANTITY*RATE

OCCURS - INDEXED BY PROGRAM: identification division. program- id. searching. environment division. data division. working-storage section. 01 table1.      0

Illustration of simple sort verb: Illustration: Suppose that we have a card file with the following records description in the data division. The names of the work fil

INPUT-OUTPUT SECTION: This section holds information regarding the files to be used in the program. There are 2 paragraphs in this section- FILE-CONTROL & I-O-CONTROL. The

File Activity: The file activity is a measure of the proportion of records processed during an update run. Therefore we define the activity ration as shown below. Activi