Example of redefines clause, COBOL Programming

Assignment Help:

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 

 


Related Discussions:- Example of redefines clause

Program for indexed sequential file creation , PROGRAM FOR INDEXED SEQUENTI...

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:

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

Fd entry for variable-length records, FD Entry for variable-length Records:...

FD Entry for variable-length Records: The RECORDS CONTAINS and BLOCK CONTAINS clause are quite dissimilar in the case of files with variable- length records. The syntax of the

Indexed sequential files, INDEXED SEQUENTIAL FILES: In the indexed seq...

INDEXED SEQUENTIAL FILES: In the indexed sequential files which are also known as indexed files, the records are stored in the sequence order generally in ascending order. In

Label record and value of clause, LABEL RECORD CLAUSE: This clause spe...

LABEL RECORD CLAUSE: This clause specifies whether or not the standard header and trailer labels must be present in the magnetic-tape files. VALUE OF CLAUSE: The VAL

Example of nested if statement, Example of Nested if statement: Illus...

Example of Nested if statement: Illustration: Consider the following sentence The nested IF sentence holds two IFs and one ELSE. The IF-ELSE couple has been marke

File-control - input-output section, FILE-CONTROL: The FILE-CONTROL pa...

FILE-CONTROL: The FILE-CONTROL paragraph names each and every file and identifies the first medium through file control entries. The basic format of a file control entry is gi

Program for if condition, PROGRAM FOR IF :   We have to write a progr...

PROGRAM FOR IF :   We have to write a program to check whether the given number is ODD or EVEN. Identification division. Program- id. Ifst. Environment division.

Indexed tables, INDEXED TABLES: The OCCURS clause that is used to defi...

INDEXED TABLES: The OCCURS clause that is used to define tables can optionally have an INDEXED phrase. This phrase involves the names of data items which are to be used as sub

Renames clause, RENAMES CLAUSE: At times re-grouping of an elementary ...

RENAMES CLAUSE: At times re-grouping of an elementary data items in a record may be essential so that they can belong to the original as well as to the latest group. This is o

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