Question

Asked:
Asked By:
Oct 11 2008   5:36 AM GMT
Girilakshmi   50 pts.

iSeries IBM


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

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



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.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Sloopy   1670 pts.  |   Oct 13 2008  3:09PM GMT

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