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

Answers were Sorted based on User's Feedback



What would be the output of the variable result? D RESULT S 5S O INZ(00011) C..

Answer / swetha p rao

Answer is b

compile time error as data types doesnt match

Is This Answer Correct ?    9 Yes 0 No

What would be the output of the variable result? D RESULT S 5S O INZ(00011) C..

Answer / guest

The correct amswer is-b
B'cos passed data item should be character type.

Is This Answer Correct ?    6 Yes 0 No

What would be the output of the variable result? D RESULT S 5S O INZ(00011) C..

Answer / karthik

FIRST Thing is "%TRIM" is valid only for


CHARACTER type variables...


so here your variable is DECIMAL... so while COMPILATION TIME ERROR OCCURS....

MSG: The parameter for %trim is not valid..

Is This Answer Correct ?    2 Yes 0 No

What would be the output of the variable result? D RESULT S 5S O INZ(00011) C..

Answer / d

compile time error

Is This Answer Correct ?    1 Yes 0 No

What would be the output of the variable result? D RESULT S 5S O INZ(00011) C..

Answer / anand

Answer is "b" - %Trim are used blanks at edges for the string.
And also you have to define 0(*zero) instead of 'O' as you
defined in D spec for zoned decimal.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More IBM AS400 AllOther Interview Questions

what is flatfile?what is the use of this file?where we can use usualy?what is the advantage of this?

2 Answers   Cognizant,


during input operation which indicator position is seton if there is a record lock?

1 Answers   IBM,


what are the different types of arrays available in rpg ?

1 Answers   IBM,


when should I use method get, and when should I use method post in my cgis?

0 Answers   IBM,


How can we find from which source the program has been compiled for a given RPGLE program object?

5 Answers  






I had ruestion in one of the interview..... If 1 file has more than 1 member and i want to use the 2nd member in the RPG pgm (in RPG400),how can I use this.... I know the possible answers i.e. useing API 'QCMDEXE' or Before calling the pgm I can use OVRDBF for that member... but I dont' want to use both the tips in above scenarion. Does any body tell me how can i use this ....?

13 Answers   Mind Tree,


what is data structure?how many types of data structers?

4 Answers  


what is the function of cpyf command?

1 Answers   IBM,


I have SQLRPGLE program in which there are some update statements which executed correctly. there were no errors run time. Once the program gets over, the file was not updated with the new values. What might be the reason?

2 Answers  


what is arrival sequence?

1 Answers   IBM,


what are activation group and what are its types.?

2 Answers   IBM,


what are the three types of keywords associated with printer file ?

1 Answers   IBM,


Categories