ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

how to enter the values at runtime in cobol400/ile

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to enter the values at runtime in cobol400/ile

    hi could any one plz help me .thanks in advance
    how to enter the values at runtime in cobol/400.
    i have written some code but not getting the exact output.

    PROCEDURE DIVISION
    CALCULATIONPRESULT.
    DISPLAY "ENTER NUM1 VALUE =".
    ACCEPT NUM1.
    DISPLAY "ENTER NUM2 VALUE =".
    ACCEPT NUM2.
    COMPUTE RESULT = NUM1 * NUM2.
    DISPLAY "RESULT = ", RESULT.

  • #2
    Re: how to enter the values at runtime in cobol400/ile

    It works fine for me. Of course, it depends on the data definitions of NUM1, NUM2 and RESULT, and on the exact characters that I type. If the variables are all S9(5) and I enter 00055 followed by 00066, it correctly displays "RESULT = 03630". It would help if you included your definitions and said what happened when you ran your program.

    Tom
    Tom

    There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

    Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

    Comment

    Working...
    X