View previous topic :: View next topic
|
Author |
Message |
DB2 Guy
New User
Joined: 28 Oct 2008 Posts: 98 Location: Cubicle
|
|
|
|
Usually, we deal with RC=0,4,8 or 16 -- all of them are even-numbers, is there any operation on MVS (specifially some error condition in COBOL or DB2 functioing) in which one can get odd-number value for RC?
My question may sound stupid, but I could not get a good link or answer for this. I searched in google but,probably, I'm not searching in the right direction..can some one please assit? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Your code can generate an rc of anything between 0 and 4095. It is really easy to try, so you might want to run a couple of experiments. I carry around a little program that accepts a parm and sets the rc to the parm value (so many rc's can be tested without needing to change the code to generate various values).
The 0, 4, 8, etc are ones that have been used by IBM modules for many, many years. They consistently represent different levels of severity.
Several sites i've supported have a standard that any application code that issues an rc must use a number greater than 100 (or 1000 some places) so there will be no confusion that the rc was application generated rather than utility generated. |
|
Back to top |
|
|
DB2 Guy
New User
Joined: 28 Oct 2008 Posts: 98 Location: Cubicle
|
|
|
|
Hello Dick,
Thanks for your reply.
I would say, instead of generating a desired value of an RC, "getting" a value of RC is my concern. Apologies, I did not calrify it well in previous post. (probably I did not how to constuct my question well in a single shot... )
Say, I'm working on a Store Procedure (SP) and a query runs well on some execution of SP -- I'll get RC=0 though I can SET/MOVE some user defined value as well. Here I would like to ask, can there be any situation, in such an application where for some operation, any default value of RC wil be =9? I understand RC can have value from 0 to 4095 so 9 is a possible value but unless we set RC=9 it's not populated as 9, right? Can there be some (default) codition which will yield RC=9, or any other odd value for RC? Or is totally user dependent what value s/he wants to set for RC?
Probably I could put my question well.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Or is totally user dependent what value |
Whoever wrote the code determines the rc. Hopefully, there was some standard list of valid rc's and their meaning. If not, all of the code that is part of the run-unit will have to be checked to see why some particular value was set. |
|
Back to top |
|
|
DB2 Guy
New User
Joined: 28 Oct 2008 Posts: 98 Location: Cubicle
|
|
|
|
Thanks Dick -- that helps. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome - good luck
d |
|
Back to top |
|
|
|