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

MAXRC=448 when calling a assembler program from Cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Jan 04, 2012 3:29 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jan 04, 2012 3:41 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Jan 04, 2012 4:14 pm
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
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Jan 04, 2012 4:19 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jan 04, 2012 4:27 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Jan 04, 2012 4:42 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jan 04, 2012 6:31 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Jan 04, 2012 7:27 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Jan 04, 2012 7:41 pm
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
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

Moderator Emeritus


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

PostPosted: Thu Jan 05, 2012 11:46 am
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jan 05, 2012 12:52 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Thu Jan 05, 2012 2:03 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jan 05, 2012 2:12 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Thu Jan 05, 2012 2:13 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts Need help with ADABAS query (COBOL-AD... All Other Mainframe Topics 0
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts Error to invoke MPP program through B... IMS DB/DC 3
No new posts Compile Sp Cobol base COBOL Programming 1
Search our Forums:

Back to Top