50 pts.
0
Q:
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
ASKED: Oct 11 2008  5:36 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
145 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
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 Answered: Oct 11 2008  7:01 PM GMT by Renojim   145 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Sloopy   1930 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

 
0