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
TO WRITE A QUADRATIC EQN ROOTS ARE COMPLEX IN COBOL PROGRAM

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

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

STATEMENTS FOR SEQUENTIAL FILES: A basic operation on a file includes the reading and writing of its records. Whenever the file is sequential, there are three verbs for the

SEQUENTIAL FILE CREATION AND REWRITING: We have to write a program to create a student file with just two fields: sno i.e. Student Number and same i.e. Student Name. Add a few

Illustration of Search verb: To illustrate the other use of SEARCH verb, assume we wish to search the similar tab to find the number of persons whose deposited amount is more

B (Blank Insertion) : The occurrence of a B anyplace in the picture will insert a space character in the edited data. There can be more than one B in the picture. Examples:

DECLARATIVE and FILE STATUS Clause: The input-output exception condition in the situation of a direct access files can be handled by a declarative procedure in a manner simila

PROGRAM FOR MASTER FILE MAINTENANCE: We have to write a program to keep the stu-file for which a record has just 2 fields,viz., rno(Roll Number) and name(Student Name). Give t

OPEN statement: We know that the processing of a file should start with the execution of an OPEN statement. The file can be opened in any one of the 4 open modes - INPUT, OUTP