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

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

Rules for constructing an arithmetic expression, Rules for constructing an ...

Rules for constructing an Arithmetic Expression: The rules for constructing an arithmetic expression are as shown below: (i) When an arithmetic expression specifies a calcu

Accept statement, ACCEPT STATEMENT: The ACCEPT statement is used to re...

ACCEPT STATEMENT: The ACCEPT statement is used to read the low-volume data from the operator's console, several other hardware device or from the operating system. The common

Illustration of the abbreviation - compound condition, Illustration of the ...

Illustration of the abbreviation: A few illustration of the abbreviation are given below: Illustration: The compound condition  AMOUNT GREATER THAN 499 AND AMOUNT L

Occurs - indexed by program, OCCURS - INDEXED BY PROGRAM: identificati...

OCCURS - INDEXED BY PROGRAM: identification division. program- id. searching. environment division. data division. working-storage section. 01 table1.      0

Example of open statement, Example of Open statement: Illustration: ...

Example of Open statement: Illustration: The OPEN INPUT TRANSACTION, OLD-MASTER OUTPUT NEW-MASTER. The illustration represents that there are two input files named the

Sequential files with the variable-length records, SEQUENTIAL FILES WITH TH...

SEQUENTIAL FILES WITH THE VARIABLE-LENGTH RECORDS: The Magnetic - tape or disk files can hold variable-length records. In this situation the file can have records with various

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

Example of write statement, Example of Write statement: Illustration:...

Example of Write statement: Illustration: (i) WRITE TRANS-RECORD AFTER ADVANCING 3 LINES. This WRITE statement specified that the TRANS-RECORD is a record name of a fi

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