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
CR and DB (Credit and Debit Sign): The two characters that is CR or DB symbol may appear only at the rightmost place of the picture. They are similar to the minus sign edit ch

Illustration of nested if statement: Consider the nested sentence which is as shown below: The IF-ELSE pairs in this sentence can be detected by applying the rule whic

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

Occurs Clause: Let us establish tables with the help of an illustration. Assume that there are ten different types of income-tax rates that are read from some input medium and

Point Location: The position of the decimal point is the other characteristic which can be specified in the case of the numeric data items. If the position is not specified, t

Plus Sign - edit characters for numeric data: + (Plus Sign) : A plus sign is alike to minus sign except that when the item is positive, +sign will be inserted rather th

LEVEL NUMBERS: The COBOL makes use of the level number concept to explain the hierarchical data structure. A level number is a 2 digit number. The permitted level numbers a

WRITE STATEMENT: The records are written to be logical place as determined from the value of the record key. The INVALID KEY condition occurs in the cases shown below: (i)

PROGRAM FOR ELECTRICITY BILL: An electricity company supplies electricity to 4 types of customers coded 1, 2, 3 & 4.The rate schedule for customers is shown in one table as

Object-Computer - Configuration section: The computer name specifies a specific computer on which the object program is to be executed. The MEMORY SIZE is used to show the