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

how to declare a constant variable in the freeformat?

0 Answers  


how to get the cursor position?

0 Answers   IBM,


Space & Skip Are Which Level Keywords?

0 Answers   IBM,


what is the maximum number of files allowed in rpg?

1 Answers   IBM,


What is the use of jdftval in as400?

0 Answers  






Can anybody know difference between SNDUSRMSG AND SNDPGMMSG IN CL PROGRAMMING? IF DON'T KNOW MAIL ME @ gkarthik.as400@gmail.com

3 Answers  


What is the purpose of PR and PI in calling program and called program? in Called program PR is compulsory?

1 Answers   HCL,


what are various techniques to pass parameters from one program to another?

1 Answers   IBM,


What are the two types of read performed on data queues?

1 Answers  


Difference Between Skip Before & Space Before?

0 Answers   IBM,


How to read 2 positions at a time in a data area? I have created a data area of length and i have to read the values of the data area like 91-92,93-94 at a time up till 100

3 Answers  


Define the purpose of the following code (If you know, how would this be written in RPG ILE) HI LO EQ C *IN66 DOUEQ *OFF C KEY1 CHAIN FILEA 90 66 C 66 CALL PGM1 PRM C ENDDO

1 Answers  


Categories