How Opcode ” MOVEL (P) ” works?

Is it padding? If yes, then how it works & what operation it performs? When to use this code?

Answer Wiki

Thanks. We'll let you know when a new response is added.


There’s a whole section on how this works in the ILE RPG Reference.


Martin Gilbert.

If you use EVAL then it does the same as MOVEL(P).

Discuss This Question: 5  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • 4hund
    wat s d difference between MOVEL and MOVEL(P)........... CAN ANYONE EXPLAIN ME..
    10 pointsBadges:
  • Buzzwords
    MOVEL left-adjusts the value in factor2 to the result field. If the length of the field in factor2 is shorter than the length of the result field, characters that aren't overwritten by the move will remain in the field. When the 'P' extender is used those rightmost characters are cleared. As far as I'm concerned the reference manual describes this in a confusing way. Essentially when you use 'P' the result field is cleared and the value of factor2 is assigned left-adjusted. This is the same effect as a simple character field assignment in free-format - the receiving field is cleared and the value is assigned left-adjusted.
    45 pointsBadges:
  • A4ginatl
    Simply, the answer is MoveL will move the characters starting from character 1 until all characters have populated the field. Any unused characters remain with the value they already have. MoveL(P) does the same as above, but it will blank out the remaining characters to the right. The EVAL op-code works in a similar way. In ILE, the idea would be to create a function to do the justification.
    95 pointsBadges:
  • Rpgrpgile
    MoveL is used as moving data from Left to Right but if data Length of Factor2 is greater then Result Field then it Truncate from Left,IF we use MOVEL(P) then it padded the data and avoid to truncation of data we use with EVAL operation also in the Extended Factor2
    20 pointsBadges:
  • graybeard52
    So the answer to the last question: When to use it ? is "Never". use the correct EVAL operation instead. Its there for support of old programs.
    3,115 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: