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
CLOSE statement: The simplified syntax of the CLOSE statement is as shown below:   CLOSE          file-name-1   [WITH   LOCK   ]                         [  , file-

ARITHMETIC VERBS: Most of the problems need some computations to be performed on the input or intermediate data that are numeric in nature. The Arithmetic verbs are used to pe

PROGRAM FOR PERFORM ...UNTIL We have to write a program to find the sum of "n" natural numbers. Identification division. Program- id. PerfUntil. Environment division.

calculate simple interest

Example of Level numbers - cobol programming: To explain the hierarchical structure introduced above, the concept of the level number is employed in COBOL. The most broad

Rules for Simple sort verb: The work file is to be defined by a sort elaboration entry (SD entry).The format of SD entry is as shown below. The rules below should be taken

PROGRAM FOR SIZE ERROR:   We have to write an easy program to elaborate the size error option. Identification division. Program- id. sizeerr. Environment division.

PROGRAM FOR INDEXED SEQUENTIAL FILE CREATION: We have to write a program to create an Indexed Sequential File in a dynamic mode for Student particulars. Suppose just 3 fields:

WRITE Statement:      The WRITE statement for a relative file has the format which is as shown below.          WRITE  record-name   [ FORM   identifier ]

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