Joined: 09 Sep 2005 Posts: 124 Topics: 52 Location: Chicago
Posted: Mon Apr 27, 2009 4:57 pm Post subject: 4038 - error while callling the sub-program?
Hi All,
I have a main CICS program B30TXY calling the sub-program ZY12TXY as shown below. I've compiled the main program B30TXY succssfully.
Code:
MOVE 'ZY12TXY' TO EZE-PROG
CALL EZE-PROG USING EZEPNTR EZEPTRAD
SET ADDRESS OF ZZWA8T1 TO EZEPNTR.
CONTINUE.
Also, I could able to compile the sub-program ZY12TXY successfully using the COBOL compiler, below is the code for the subprogram ZY12TXY.
Code:
IDENTIFICATION DIVISION.
PROGRAM-ID. ZY12TXY.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY ZZWA8T1V.
LINKAGE SECTION.
77 EZEPTRAD PIC X(8).
77 EZEPTR USAGE IS POINTER.
PROCEDURE DIVISION USING EZEPTR EZEPTRAD.
SET EZEPTR TO ADDRESS OF EZEVAL-ZZWA8T1.
GOBACK.
while XPEDting the main CICS program, when the control reaches the point "CALL EZE-PROG USING EZEPNTR EZEPTRAD " calling the subprogram its abending with 4038.
"If you use HANDLE CONDITION or HANDLE AID, you can avoid addressing problems by using SET(ADDRESS OF A-DATA) or SET(A-POINTER) where A-DATA is a structure in the LINKAGE SECTION and A-POINTER is defined with the USAGE IS POINTER clause. "
Could some body please help how I can avoid this abend. Is this like I have to use the HANDLE CONDITION in subprogram? but the subprogam is not a CICS program.
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
Posted: Mon Apr 27, 2009 5:32 pm Post subject:
Digger,
good evening. you never fail to provide provocative questions. Made my day.
well first of all, you looked in the wrong error list - 4038 is an LE error,
Robert Sample will come along and provide you with the correct link
(because I don't have a link for LE errors).
This is an old COBOL II trick to load a W-S pointer with a W-S data address,
which we could not do until COBOL 3.
you have it a little (no alot) backwards:
CALLing Program:
Code:
CALL EZE-PROG USING EZEPNTR EZEPTRAD
Instead of EZEPNTR in your CALLing Program,
the code should be the reference of a W-S variable with usage pointer.
Instead of EZEPTRAD in your CALLing Program,
the code should be the reference of a W-S area/field.
also, there is no need to have a set pointer after the CALL,
that is the purpose of the CALL.
CALLed Program:
Code:
PROCEDURE DIVISION USING EZEPTR EZEPTRAD.
SET EZEPTR TO ADDRESS OF EZEVAL-ZZWA8T1.
The SET instruction should be
SET EZEPTR TO ADDRESS OF EZEPTRAD.
First, insure that the Pointer and the area/field used in the CALL
are contained in W-S of your CALLing Program
(If your CALLing Program has itself been CALLed,
your pointer and area can be in Linkage, but then there is no need,
because even in COBOL II you could set a linkage section POINTER
to a Linkage Section AREA/FIELD.
Second, modify your SET statement in the CALLed program as I indicated
repeated here:
SET EZEPTR TO ADDRESS OF EZEPTRAD. _________________ Dick Brenholtz
American living in Varel, Germany
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
Posted: Mon Apr 27, 2009 5:48 pm Post subject:
Or, are you trying to address an area of the CALLed program in the CALLing program?
if so,I will tell you how to clean up your code for that.
By the way
Quote:
CAUSE: LE/370 UNHANDLED COND(HELP 4038)
means: In LE (language environment) there was a condition that was not handled
- an abend code was issued -
you would get the same thing in batch if you used the same code.
nothing to do with CICS HANDLE API. _________________ Dick Brenholtz
American living in Varel, Germany
Joined: 09 Sep 2005 Posts: 124 Topics: 52 Location: Chicago
Posted: Tue Apr 28, 2009 11:11 am Post subject:
Thank you Kolusu , Dick
I could able to resolve the issue:
1. When I compiled the subprogram with the COBOL compiler I was facing the abend 4038 when the control is trying to execute the CALL statement.
2. When I compiled the subprogram with the COBOL + CICS compiler (even though the subprogram is just a COBOL program) I could able to atleast enter into the Subprogram in the debugger but the POINTER varible EZEPTR in the subprogram is showing up as "UNABLE TO DETERMINE ADDR"
3. Now, when I changed the parameters for the calling program in the Main called program as below adding DFHEIBLK DFHCOMMAREA and compiling with COBOL+CICS compiler the issue got resolved.
Code:
MOVE 'ZY12TXY' TO EZE-PROG
CALL EZE-PROG USING DFHEIBLK DFHCOMMAREA
EZEPNTR EZEPTRAD
SET ADDRESS OF ZZWA8T1 TO EZEPNTR.
CONTINUE.
Dick:
I think you might want to suggest the same thing
Quote:
Or, are you trying to address an area of the CALLed program in the CALLing program?
if so,I will tell you how to clean up your code for that.
Thank you very much once again _________________ Tx
Digger
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