MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Weird return codes in jcl output

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
mfnerd
Beginner


Joined: 06 Jan 2003
Posts: 8
Topics: 6

PostPosted: Thu Sep 04, 2003 2:54 pm    Post subject: Weird return codes in jcl output Reply with quote

I've some jobs using os/vs cobol programs and the return codes from those jobs are weird.Example one step has a return code of 56 but to my surprise the job doesn't abend.Any thoughts ?

Thanks.
_________________
Thanks,
Mfnerd.
Back to top
View user's profile Send private message
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Thu Sep 04, 2003 3:02 pm    Post subject: Reply with quote

The program can set whatever RC it wants to. For example we have a program that simply sets the RC to the numeric day of the week.
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Thu Sep 04, 2003 5:36 pm    Post subject: Reply with quote

I'd put it this way, there is no such thing as a wierd condition code, just conditions codes that you haven't encountered before. A condition code can be any number between 0 and 4095. No condition code means anything in general (perhaps 0 could be considred the exception, however a program could be written to issue a 0 in the case of an abnormal situation, if that were desired), although frequently people conisder 4 or less to be acceptable and 8 or greater to be severe.

In addition to Taltyman's reply a program can also issue abends, generally USER abends, something which is quite distinct from a return code (or in my opinion should be considered as such). I believe that the distinction should be that a return code should signify an event that has been handled which may then require different paths to be taken. Abends should indicate that something severe has happened and that processing should stop.

However more and more it seems that the grey area between the two widens and has virtually, or even has, encompassed both. Or is it that I'm just getting too old Smile
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Fri Sep 05, 2003 2:03 pm    Post subject: Reply with quote

The "usual" reason for "weird" return codes is the failure of a program to EXPLICITLY move a value to General Register 15 prior to ending. For COBOL programs Register 15 is set by moving a numeric value to the RETURN-CODE special register just before the GOBACK statement. For an assembler program, this is done by moving a numeric value to General Register 15 before returning to its invoking program. If R15 ( RETURN-CODE ) is NOT explicitly set, whatever value it contains when the program terminates, is considered that program's return code. The contents of R15 could be an address, or any other value stored there during processing. When a COBOL program calls another module, that module's return code ( R15 ) is automatically move to RETURN-CODE when it returns, so that it may be tested by the COBOL program. Perhaps that is what your problem is - residual value in RETURN-CODE due to a CALL.

Ron
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Mon Sep 08, 2003 3:27 am    Post subject: Reply with quote

If it is R15 then why is RC between 0 and 4095?
Back to top
View user's profile Send private message Send e-mail
Brian
Beginner


Joined: 12 Aug 2003
Posts: 95
Topics: 6

PostPosted: Mon Sep 08, 2003 8:18 am    Post subject: Reply with quote

Dibakar,

RETURN-CODE is a S9(4) COMP variable. All negative return codes are represented by its equivalent 2's complement value.

MOVE -40 TO RETURN-CODE would return 4056 (4095 - 40) + 1.

Hope this answers your question.
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Tue Sep 09, 2003 12:12 am    Post subject: Reply with quote

Brian,

This answers partly.

But my question is if I move X'FFFFFFFF' to RETURN-CODE then what will be the RC? Isn't it much larger than 4095?
Back to top
View user's profile Send private message Send e-mail
Brian
Beginner


Joined: 12 Aug 2003
Posts: 95
Topics: 6

PostPosted: Tue Sep 09, 2003 2:03 am    Post subject: Reply with quote

Dibakar

When in doubt try Mr. Green

Assume you move a value larger than 4095 the RC would be wrapped around.
MOVE 5095 TO RETURN-CODE should return 999 (5095 - 4095) - 1.

Hope this answers your question.
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Tue Sep 09, 2003 2:19 am    Post subject: Reply with quote

Brian,

Sometimes asking is too easy.

Thanks again.
Diba.
Back to top
View user's profile Send private message Send e-mail
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sat Sep 13, 2003 9:42 am    Post subject: Reply with quote

Hi Diba,

My guess is that RC is set with a LH (load halfword) BAL instruction. But, Brian is right "When in doubt try".

Anybody out there have an S9000 in their rec room? Smile

Regards, Jack.
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Sun Sep 14, 2003 4:51 pm    Post subject: Reply with quote

I think, to be safe, you'd use L (load fullword). Just loading half word could leave data in R15, that's assuming that you were loading the register from a memory location. Another alternative is to use LA, this allows you to set a cc using a constant/specific value(e.g. you could do LA 15,8 to set rc=8). To set 0 you could also use SR 15,15 (subtract register).
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sun Sep 14, 2003 9:50 pm    Post subject: Reply with quote

Hi Mike,

It's been a long time since I used BAL, but I think the high order bit of the storage data that's loaded is propagated to the remaining bits in the register when an LH is executed. I think that's the way it USED TO WORK, anyway.

Anyway2, your main point my be right, that a Load (L) or Load Address (LA) is used. But it doesn't explain why the RC is limited to 4095 in spite of the fact that an RC > 4095 apparently CAN be created.

Perhaps subsequent processing by the system uses a STH or LH. A lot of these limitations were generated back when saving a halfword here and there was a big deal. Smile

Regards, Jack.
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Sun Sep 14, 2003 10:30 pm    Post subject: Reply with quote

Hi Jack,
you're right regarding the propogation of the high order/sign bit (I didn't word what I was saying that well, I didn't mean to imply that more data than the half word would be moved (I can see how it could be read that way). I meant to say that LH and L are used if the RC was stored in memory, as opposed to LA where the RC is hard coded.

I think, but I'm not sure, that the limitation of 4095 is more to do with JES/JCL storing the code intetnally as a halfword. If I had the time I'd write a quick program to see if passing a return code greater than 4095 is possible between modules (my guess is that it would be). Just a little busy at present. I'd put it in the same class as why job names are limited to 8 chars etc etc etc Smile
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Mon Sep 15, 2003 4:29 pm    Post subject: Reply with quote

Anything higher than 4095 spills over into the SYSTEM abend bits. If you load too large a value, you can see BOTH a system and user abend code at the same time.

Regards,
Bill
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Tue Sep 16, 2003 5:07 am    Post subject: Reply with quote

Thanks Bill. That clears my doubt.

Regards,
Diba.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group