View previous topic :: View next topic
|
Author |
Message |
mchanapa
New User
Joined: 17 Nov 2011 Posts: 36 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
mchanapa
New User
Joined: 17 Nov 2011 Posts: 36 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
|
mchanapa
New User
Joined: 17 Nov 2011 Posts: 36 Location: India
|
|
|
|
Is there anyway to solve this issue |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
yes!
( if You do not like YES/NO answers, learn not to ask YES/NO questions ) |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
mchanapa
New User
Joined: 17 Nov 2011 Posts: 36 Location: India
|
|
|
|
I have tried this . .
its giving the return code as 400 after executing the assembler program (after call statement) |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
|
mchanapa
New User
Joined: 17 Nov 2011 Posts: 36 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
Back to top |
|
|
mchanapa
New User
Joined: 17 Nov 2011 Posts: 36 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
Back to top |
|
|
|