View previous topic :: View next topic |
Author |
Message |
chandanm Beginner
Joined: 31 Aug 2004 Posts: 12 Topics: 9
|
Posted: Tue Aug 31, 2004 12:23 am Post subject: Calling Batch COBL program in PL/1 program macro-level CICS |
|
|
Hi all,
Could you let me know whether it is possible to call a Batch COBOL program through a PL/1 program containing macro-level CICS.
If so, what would be the DCL statement for the called program.
Also, please let me know the reason if it is not possible to call a Batch program.
I have been getting a 4038 ABEND when trying to do so.
Regards,
Chandan |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Aug 31, 2004 5:50 am Post subject: |
|
|
chandanm,
Check this link which gives a detailed explanation of Communicating between COBOL and PL/I.
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA4120/11.0?DT=20040115140447
simply you can try calling using pointers
PLI code:
Code: |
pointer1=addr(area1)
pointer2=addr(area2)
call routine(pointer1, pointer2, variable1, variable2).
|
Cobol:
Code: |
linkage section.
01 pointer1
01 area1
01 pointer2
01 area2
01 variable1
01 variable2
procedure division using pointer1,
pointer2,
variable1,
variable2.
set address of area1 to pointer1
set address of area2 to pointer2
|
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
chandanm Beginner
Joined: 31 Aug 2004 Posts: 12 Topics: 9
|
Posted: Tue Aug 31, 2004 10:12 am Post subject: Re: Call Batch COBL program in PL/1 program macro-level CICS |
|
|
U have given me an examples using pointers. But are pointers supported in Batch COBOL programs?
Also, could you please let me know the PIC clauses for the pointer and area in COBOL.
I need pass to empty variable to the COBOL program, which will then calculate some values and pass it back to the PL/1 program.
The call statement that I am using is --
CALL routine (var1,var2);
I have declared the routine as
DCL routine ENTRY OPTIONS (COBOL,INTER);
In the Linkage section of COBOL program, I have declared two variables of same PIC clause as used in PL/1.
Am I on the right track? ... What else do I need to do? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Aug 31, 2004 11:34 am Post subject: |
|
|
Chandanm,
Quote: |
I need pass to empty variable to the COBOL program, which will then calculate some values and pass it back to the PL/1 program.
|
I just coded this example to calculate the power of variable sent to the cobol program and the PLI program receives the result.
PLI source:
Code: |
PLICBL: PROC OPTIONS(MAIN);
/**********************************************************/
/* DECLARE ENTRY FOR THE CALL TO COBOL */
/**********************************************************/
DCL PL1CBSB EXTERNAL ENTRY(
/*1*/ FIXED DECIMAL(10,0),
/*2*/ FIXED DECIMAL(10,0))
OPTIONS(COBOL);
/**********************************************************/
/* DECLARE PARAMETERS: */
/**********************************************************/
DCL PLI_INVAR FIXED DECIMAL(10,0) INIT(12);
DCL PLI_OUTVAR FIXED DECIMAL(10,0) INIT(0);
/**********************************************************/
/* PROCESS STARTS HERE */
/**********************************************************/
PUT SKIP LIST( '*******************************************');
PUT SKIP LIST( 'PL/I CALLING COBOL EXAMPLE IS NOW IN MOTION');
PUT SKIP LIST( '*******************************************');
PUT SKIP;
CALL PL1CBSB( PLI_INVAR,
PLI_OUTVAR);
PUT SKIP LIST( '*******************************************');
PUT SKIP LIST( 'OUTPUT FROM COBOL IS:', PLI_OUTVAR);
PUT SKIP LIST( 'PL/I CALLING COBOL SUBROUTINE EXAMPLE ENDED');
END PLICBL;
|
COBOL source:
Code: |
IDENTIFICATION DIVISION.
PROGRAM-ID. PL1CBSB
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 W-RESULT PIC S9(10) COMP-3.
LINKAGE SECTION.
01 INPUT-VAR PIC S9(10) COMP-3.
01 OUTPUT-VAR PIC S9(10) COMP-3.
PROCEDURE DIVISION USING INPUT-VAR,
OUTPUT-VAR.
DISPLAY '***************************************'.
DISPLAY 'COBOL PROGRAM ENTERED FROM PL/I PROGRAM'.
DISPLAY '***************************************'.
DISPLAY '***************************************'.
DISPLAY ' INPUT-VAR :' INPUT-VAR
DISPLAY ' OUTPUT-VAR :' OUTPUT-VAR
DISPLAY '***************************************'.
COMPUTE W-RESULT = INPUT-VAR ** 2
MOVE W-RESULT TO OUTPUT-VAR
DISPLAY ' OUTPUT-VAR ' W-RESULT
GOBACK.
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|