Example of move corresponding, COBOL Programming

Assignment Help:

Example of Move corresponding:

Consider the DATA DIVISION entries shown below.

377_Example of Move corresponding.png

198_Example of Move corresponding1.png

Suppose it is needed that the data stored in the 4 fields of the PAY_REC should be moved to those fields of PRINT_REC which are given the similar data names. The following 4 MOVE statements can serve the aim.

 

         MOVE ID-NUMBER OF PAY-REC TO ID-NUMBER OF PRINT-REC.

         MOVE NAME OF PAY-REC TO NAME OF PRINT-REC.

         MOVE DEPARTMENT OF PAY-REC T0 DEPARTMENT OF PRINT-REC.

         MOVE BASIC-PAY OF PAY-REC TO BASIC-PAY OF PRINT-REC.

 

Though, as both the records have similar names for the concerned data items, the statement below

 

         MOVE CORRESPODING PAY-REC TO PRINT-REC.

 

will have the similar effect. It is not essential that the corresponding data names in the two records must appear in similar order. The common format of the MOVE CORRESPONDING statement is

1123_Example of Move corresponding2.png

where the identifier-1 and identifier-2 should be group names. Note that the MOVECORRESPONDING is not a group move; it is just a means for specifying the number of elementary moves through a single MOVE statement. Any of the as such editing, if specified, will be performed. The Source and destination groups can involve data names which are not common. Only those fields having similar names in the two records will take part in the data movement. The left over data items in the destination group will stay unchanged.


Related Discussions:- Example of move corresponding

Go to, GO TO, STOP RUN: The GO TO verb is used to completely transfer ...

GO TO, STOP RUN: The GO TO verb is used to completely transfer the control to elsewhere in the program. Its form is as shown below: GO TO procedure-name As a result o

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

Write statement - sequential files, WRITE statement: The WRITE stateme...

WRITE statement: The WRITE statement for tape and sequential-disk files has the syntax shown below. WRITE            record-name      [  FROM    identifier   ] As a resu

Program for renames clause, PROGRAM FOR RENAMES CLAUSE: identification...

PROGRAM FOR RENAMES CLAUSE: identification division. program- id. environment division. data division. working-storage section. 01 emp.      02 empdet.

Conditions-name condition, CONDITIONS-NAME CONDITION:   The condition...

CONDITIONS-NAME CONDITION:   The condition name is an entity which itself is a condition and these can have either a true or false value. Though, a condition name cannot be d

Example of level numbers - cobol programming, Example of Level numbers - co...

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

Example of redefines clause, Example of Redefines clause: This illustr...

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

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

Data names and identifiers - cobol program, Data Names and Identifiers:   ...

Data Names and Identifiers:   The Data name provides reference to the storage space in the memory where the real value is stored. This value takes part in the operation whene

Blank when zero - edit characters for numeric data, BLANK WHEN ZERO: ...

BLANK WHEN ZERO: BLANK WHEN ZERO is an editing clause that may be used along with a picture. This will set the whole data item to blanks of its value is equal to zero. Though,

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