Example of move corresponding, COBOL Programming

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.

Posted Date: 10/16/2012 6:13:56 AM | Location : United States







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

Write discussion on Example of move corresponding
Your posts are moderated
Related Questions
NONSTANDARD CLAUSES: The various clauses explained above are as per the ANSI standard. Also, most compilers provide for additional nonstandard clauses to meet the specific nec

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

READ STATEMENT: The aim of this verb is to make available the next logical record from the input file. It is important to note the meaning of the "next" logical record in the

DISPLAY STATEMENT:   The function of the DISPLAY statement is just opposite to that of the ACCEPT statement. It is used to display the low-volume results on the operator's co

Currency Sign - edit characters for numeric data: $ (Currency Sign): The single currency sign can appear at the leftmost place of a picture. In that situation the $ cha

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

Example of Perform statement: PERFORM BEGIN-CALCULATION THRU END-CALCULATION. Assume, BEGIN-CALCULATION and END-CALCULTION is paragraph names. The execution of the PERFORM

Non numeric: The nonnumeric literal is used in normal to output messages or headings. The Characters which are enclosed between " " constitute nonnumeric literal. The maximum

How do i write a simple cobol programming that works

Illustration of if- else statement: IF OK-BALANCE NEXT SENTENCE ELSE MOVE 2 BALANCE-CODE In this illustration, the OK-BALANCE is a condition name. No action is specific if