how Opcode ” MOVEL (P) ” works?

75 pts.
Tags:
AS/400
ILE RPG
MOVEL
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.

Hi,

There’s a whole section on how this works in the <a href=”http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/index.jsp?topic=/rzasd/sc092508974.htm&tocNode=int_232486″>ILE RPG Reference</a>

Regards,

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • 4hund
    wat s d difference between MOVEL and MOVEL(P)........... CAN ANYONE EXPLAIN ME..
    10 pointsBadges:
    report
  • 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:
    report
  • 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:
    report
  • 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:
    report
  • 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:
    report

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following