IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

can Return-code have odd-number values?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
DB2 Guy

New User


Joined: 28 Oct 2008
Posts: 98
Location: Cubicle

PostPosted: Thu Jul 16, 2009 11:48 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 17, 2009 12:00 am
Reply with quote

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
View user's profile Send private message
DB2 Guy

New User


Joined: 28 Oct 2008
Posts: 98
Location: Cubicle

PostPosted: Fri Jul 17, 2009 12:27 am
Reply with quote

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... icon_smile.gif)

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.. icon_neutral.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 17, 2009 1:52 am
Reply with quote

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
View user's profile Send private message
DB2 Guy

New User


Joined: 28 Oct 2008
Posts: 98
Location: Cubicle

PostPosted: Fri Jul 17, 2009 9:56 pm
Reply with quote

Thanks Dick -- that helps.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 17, 2009 10:01 pm
Reply with quote

You're welcome - good luck icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
Search our Forums:

Back to Top