Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

MAXRC=448 when calling a assembler program from Cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
mchanapa

New User


Joined: 17 Nov 2011
Posts: 36
Location: India

PostPosted: Wed Jan 04, 2012 3:24 pm    Post subject: MAXRC=448 when calling a assembler program from Cobol
Reply with quote

Hi . .

I am calling a assembler program from cobol program as below.

CALL "EDITCALL" USING WS-HASH-DATA
WS-HASH-TOTAL
WS-TCR-LENGTH.

01 WS-CALL-WORK.
05 WS-TCR-LENGTH PIC S9(04) VALUE +170 COMP SYNC.

01 WS-CALL-DATA PIC X(170) VALUE SPACES.

01 WS-CALL-TOTAL PIC X(02) VALUE SPACES.


and i have moved the data correctly also as below before calling the program.

MOVE IP-TRAN-RECORD TO WS-CALL-DATA
MOVE IP-CALL-TOTAL1 TO WS-CALL-TOTAL


Now my problem, my job is completing with MAXRC=0448, but the output file is coming as i expected.

Why the return code is coming like this.
Please help to resolve this issue.

Regards,
mchanapa
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Jan 04, 2012 3:29 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

Quote:
Why the return code is coming like this.
Please help to resolve this issue.

because the return code chain is broken.
little we can do from here.
check the chain/hierarchy of the calls and fix the <program> issuing/setting the <invalid> RC
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Wed Jan 04, 2012 3:41 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

How do tje CALL-DATA fields your have shown relate to HASH-DATA fields you are passing to the assembler program?

Is the assembler program setting a value in register 15 before returning?
Back to top
View user's profile Send private message
mchanapa

New User


Joined: 17 Nov 2011
Posts: 36
Location: India

PostPosted: Wed Jan 04, 2012 4:08 pm    Post subject:
Reply with quote

No No iam using HASH-DATA fileds only, i have wrogly pasted the code above.
Plz consider HASH-DATA and CALL-DATA as same.

In the assembler program R15 is not present.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Jan 04, 2012 4:14 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

r15 is alway there alive and kicking !
the fact that Your assembler program is not referring to it does not mean that r15 does not contain a value
Back to top
View user's profile Send private message
mchanapa

New User


Joined: 17 Nov 2011
Posts: 36
Location: India

PostPosted: Wed Jan 04, 2012 4:17 pm    Post subject:
Reply with quote

Is there anyway to solve this issue
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Jan 04, 2012 4:19 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

yes!

( if You do not like YES/NO answers, learn not to ask YES/NO questions )
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Wed Jan 04, 2012 4:27 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

RETURN-CODE is a Cobol "special register".

If you DISPLAY ">" RETURN-CODE "<" after the CALL, let us know what the value is.
Back to top
View user's profile Send private message
mchanapa

New User


Joined: 17 Nov 2011
Posts: 36
Location: India

PostPosted: Wed Jan 04, 2012 4:41 pm    Post subject:
Reply with quote

I have tried this . .

its giving the return code as 400 after executing the assembler program (after call statement)
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Jan 04, 2012 4:42 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

what it is that was not clear in my previous reply ?

Quote:
check the chain/hierarchy of the calls and fix the <program> issuing/setting the <invalid> RC
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Wed Jan 04, 2012 6:31 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

Sorry, forgot to ask you to do before the CALL as welll. This, taking both together, will tell you whether the assembler (or something it is using) is setting the value, or not. You can check the RETURN-CODE in other likely places if it turns out not to be the Assembler. If your module is called, then the first statement of the program is another place.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Jan 04, 2012 7:27 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

Please post the code from the Assembler sub-program that returns control to COBOL.

As has been said several times, your R15 value (RETURN-CODE SPECIAL-REGISTER) is bogus and/or residual.

It is worth noting that COBOL treats the R15 value as a binary-halfword and depending on the TRUNC option, the maximum value is affected.

Mr. Bill
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Jan 04, 2012 7:41 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

but remember also the modulo 4096 behavior ...
from an assembler and r15 content point of view

a 448 RC would simply imply that the r15 content was 448 + 4096 * n ( n = 0,1,... )

just checked with 4098 and the step RC was 2
Back to top
View user's profile Send private message
mchanapa

New User


Joined: 17 Nov 2011
Posts: 36
Location: India

PostPosted: Thu Jan 05, 2012 10:02 am    Post subject:
Reply with quote

Code:
R1       EQU   1           
R2       EQU   2           
R3       EQU   3           
R4       EQU   4           
R5       EQU   5           
R6       EQU   6           
R7       EQU   7           
R8       EQU   8           
R9       EQU   9           
         STM   14,12,12(13)
         BALR  9,0         
         USING *,9         
         L     R6,0(,R1)   
         L     R8,8(,R1)   
         LH    R8,0(,R8)   
         BCTR  R8,0       
         LA    R3,2(,R6)   
         LA    R4,2       
         LA    R5,0(R8,R6)
         SR    R7,R7       
         IC    R7,0(,R6)   
         SLL   R7,8       
         IC    R7,1(,R6)   
         B     EH10       
EH00     EQU   *           
         IC    R6,0(,R3)   
         SLL   R6,8       
         IC    R6,1(,R3)   
         XR    R7,R6       
EH10     EQU   *           
         SR    R6,R6       
         SLDL  R6,20       
         SRL   R7,16       
         OR    R7,R6       
         BXLE  R3,R4,EH00 
         L     R6,4(,R1)   
         STC   R7,1(,R6)   
         SRL   R7,8       
         STC   R7,0(,R6)   
         LM    14,12,12(13)
         BR    14         
         END   EDITCALL

This is the assembler program called by my cobol.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Thu Jan 05, 2012 11:46 am    Post subject:
Reply with quote

Hello,

And why have you not set R15 to the value zero (or whatever rc you want for a return code) before returning to the caller?

Quote:
As has been said several times, your R15 value (RETURN-CODE SPECIAL-REGISTER) is bogus and/or residual.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Jan 05, 2012 12:52 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

Mmmm.... so the low-order part of the start address of your assembler module becomes the return-code. Can explain the changing value, as well.

Now, how to get it to load on a page-boundary, then evertything will be OK. :-)
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jan 05, 2012 2:03 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

if Your organization does not have the basic assembler skill of zeroing register 15 before returning to the caller
it should refrain from using assembler icon_cool.gif
Back to top
View user's profile Send private message
mchanapa

New User


Joined: 17 Nov 2011
Posts: 36
Location: India

PostPosted: Thu Jan 05, 2012 2:07 pm    Post subject:
Reply with quote

That assembler program is using from last 5 years successfully.
It may be error with my cobol program at calling the assembler.

I will check that again...

Thanks for the help.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Jan 05, 2012 2:12 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

Interesting. For five years, then, it has been on a page-boundary (or a similar location giving you a low-order two bytes of binary zeros in the address).

Is the Cobol compiled NODYNAM when it should be DYNAM?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jan 05, 2012 2:13 pm    Post subject: Reply to: Getting MAXRC=448 when calling a assembler program
Reply with quote

Quote:
That assembler program is using from last 5 years successfully.

utter nonsense...
the fact that the program has been in use for the last five years
does not prevent from being poorly written
see my previous answer !

in Your case successfully means that nobody found out ...
my definition of successfully is a bit different from Yours icon_cool.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us