50 pts.
 iSeries IBM
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

Software/Hardware used:
ASKED: October 11, 2008  5:36 AM
UPDATED: October 13, 2008  3:09 PM

Answer Wiki:
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.
Last Wiki Answer Submitted:  October 11, 2008  7:01 pm  by  Renojim   145 pts.
All Answer Wiki Contributors:  Renojim   145 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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 pts.