iSeries IBM

50 pts.
Tags:
AS/400
RPG
RPG/400
What would be the output of the variable result? D RESULT S 5S O INZ(00011) C EVAL RESULT = %TRIM(RESULT) Please give me the correct answer for this A.0001 b.compile time error c.11 d.Runtime error

Answer Wiki

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

First, your statement is invalid; RESULT is numeric, %Trim doesn’t work with numeric. You can:
1 Make the field char, then make the results of %trim numeric again:
C eval RESULT = %int(%TRIM(%char(RESULT)))
In which case RESULT = 00011
Or

You could return it to a character field instead of the original numeric:
C eval Alpha5 = %TRIM(%char(RESULT))
In which case ALPHA5 = ’11 ‘
Or

any number of other options. But the point is your original statement won’t work.

Discuss This Question: 1  Reply

 
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
  • Sloopy
    Since this is obviously a question from a test paper, I suggest that you try reading the RPG Reference manual, or write a program and work it out for yourself! :-D
    2,195 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