Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 6: Procedure Division


DATA MOVEMENT VERB: MOVE verb

  • It is used to copy data from the one source data item (variable/identifier) or literal to the one or more destination data items
  • The source and destination data item can be group or elementary data items
  • Syntax:-

    MOVE  {identifier-1|literal-1|figurative-constant} TO identifier-2 [, identifier-3 ]…

  • MOVE rules:-
    • The value contained in identifier-1 or indicated by literal-1 or figurative-constant is moved to the identifier-2, identifier-3
    • Sending field can be only one
    • Receiving field can be one or more
    • Sending field remain unaltered after operation
    • Numeric move rules:-
      • When receiving field is numeric or numeric-edited, then the move is considered as a Numeric move
      • In numeric moves, the data is aligned along the decimal point and accordingly the data is filled in receiving field
      • For the integer part of the number, the movement is done from right to left.
      • For the decimal part of the number, the movement is done from left to right.
      • When receiving field’s width is larger than width of sending field, zero-fill takes place in unfilled positions. Zero-suppression or insertion of editing symbols takes place according to the rules of editing pictures.
      • When receiving field’s width is smaller than width of sending field, then excess digits to the left/or to the right of the decimal point are truncated
    • Alphanumeric Move rules:-
      • When receiving field is alphabetic, alphanumeric or alphanumeric-edited, then the move is considered as Alphanumeric move
      • In alphanumeric move, data is filled from left to right [unless RIGHT JUSTIFIED is specified]
      • When receiving field’s width is larger than width of sending field, unfilled positions are filled with spaces
      • When receiving field’s width is smaller than width of sending field, then the receiving field fills the positions from left to right until it is completely occupied. The un-accommodated characters on the right of the sending field are truncated
    • When sending field is alphanumeric and receiving field is numeric, or numeric-edited, then the item is moved as if it were an unsigned numeric integer
  • Permissible MOVE operations:-
Examples for understanding MOVE statements
         MOVE A TO B



Advertisements






© copyright mainframebug.com
Privacy Policy