ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Where can I find the status codes returned by a failing command?

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

  • #16
    Re: Where can I find the status codes returned by a failing command?

    Yep... Already looked at it before posting the question (in IBM's documentation). Just not sure if it's worth the effort in this case. Looks like you have to input the message file, and I wasn't sure how to determine that. I know where the CPF messages are located, but this is an HTP message. It wasn't obvious to me if that info was returned in the PSDS.
    I apologize... I learned RPG and ILE "the hard way".

    Comment


    • #17
      Re: Where can I find the status codes returned by a failing command?

      No worries just keep learning...
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #18
        Re: Where can I find the status codes returned by a failing command?

        The error status codes can be found within Chapter 5 in the RPG Reference:
        File Status Codes
        Program Status Codes

        These Codes can be trapped with either a Monitor Group or with the built-in-function %STATUS (if the extention (E) was specified with the previous opcode).
        The associated message ids and message textes are located within the message file QRNXMSG.
        The message id is composed of RNX + File/Program Status code, that means status code 102 = divide by zeros (according the RPG Reference), the message id is RNX0102 and the message text in the message file QRNXMSG is "Attempt to divide by zero.".

        Birgitta

        Comment


        • #19
          Re: Where can I find the status codes returned by a failing command?

          Thanks, Birgitta. I'd like to point out to those searching that some of the messages in QRNXMSG start with a different prefix, and some can start with more-than-one prefix. For example, there is no RNX0401, but there _is_ RNQ0401 "Data area specified on IN/OUT not found". And there is both an RNQ0412 "Data area &6 is not allocated for output (C G D F)", Severity 99, and an RNX0412 "Data area &2/&1 is not allocated for output", Severity 50. (At least as of v5r4.)

          Jerry

          Comment


          • #20
            Re: Where can I find the status codes returned by a failing command?

            I think there's an RNQ message for every status code. Even the non-error status codes like 10 and 11 (eof and not found). If I recall correctly, those non-error messages exist just so the status can be printed in the formatted dump.

            There's no matching RNX message when the error condition can always be determined from a particular system message. For example, the "data area not found" status of 401 is determined by whatever is the system CPF message that the RPG runtime gets when it tries to get the data area, so RNX0401 isn't needed. But the situation where the data area is locked and you do an OUT opcode is an RPG error, not a system error, so RPG signals RNX0412 to set that error condition.

            Comment

            Working...
            X