Page 1 of 1

Cobol MOVES

PostPosted: Tue Dec 21, 2010 10:59 pm
by reebahs
What is the difference between MOVE and MOVE CORRESPONDING ?
also kindly answer the following.

Thank you
01 GRP1
02 GRP1-ELEM-ITEM1 PIC X(5) VALUE 'ABCDE'.
02 GRP1-ELEM-ITEM2 PIC 9(7) VALUE 1234567.

01 GRP2
02 GRP2-ELEM-ITEM1 PIC X(5).
02 GRP2-ELEM-ITEM2 PIC X(7).
02 GRP2-ELEM-ITEM3 PIC 9(7).
02 GRP2-ELEM-ITEM4 PIC A(7).

PROCEDURE DIVISION.
MOVE GRP1 TO GRP2.
DISPLAY GRP2.
MOVE CORRESPONDING GRP1 TO GRP2.
DISPLAY GRP2.

Re: Cobol MOVES

PostPosted: Wed Dec 22, 2010 2:04 am
by NicC
Please read the COBOL Language Reference manual - answering questions like this is what it is for. If you HAVE read it and there is something you do not understand then post regarding the bit that you do not understand.