AS/400 code execution

15 pts.
Tags:
AS/400
AS/400 - CL Command

Please help me answer this sample question:

What will be the value of IZ during the execution of the following code, when statement 09.0 is reached? (Field length 30 implies 3 byte numeric – 0 decimal).

01.0 C Z-ADD 100 IY 30

02.0 C Z-ADD 0 IZ 30

03.0     *--------------------------------

04.0 C IY DOULT          99

05.0 C ADD 1 IZ

06.0 C ADD 10 IY

07.0 C ENDDO

08.0     *--------------------------------

09.0 C Z-ADD 1 IY

A) 0 B) 1 C)  90 D)  99 E) 100



Software/Hardware used:
software

Answer Wiki

Thanks. We'll let you know when a new response is added.

This appears to be a question from a test.

Have you tried to run the code?

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Since it's easy enough to calculate, is there a problem? We can't provide answers for questions like these. The RPG Reference manual provides any needed detail on how the statements work. Post your reasoning from your understanding of the code, and we might point to Reference manual details. Do you know if it's RPG III or RPG IV? -- Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    We can, however, provide help.  Tell us what you think is happening and we'll guide you along.  I would recommend focusing on the RPG III menuals. 
    51,365 pointsBadges:
    report
  • ToddN2000
    If you have a computer to run this on try using debug and follow the logic.Other than that, look at your starting values and follow the logic. When is you loop run ? What values are changed within the loop? When do I exit the loop? 
    15,605 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following