Cobol calling PL1 
Author Message
 Cobol calling PL1

Hi,

    Can anybody post an example of a Cobol program calling a PL1 program?
I'm able to do that but performance wise the program takes too long loading
and unloading the PL1 modules. Is there any way to get around this?

Thanks,
Fabricio



Tue, 10 Jul 2001 03:00:00 GMT  
 Cobol calling PL1
My advise is not to do this. We experienced many problems with this. You
betta spend your time in translating one of them.
Quote:
>Can anybody post an example of a Cobol program calling a PL1 program?
>I'm able to do that but performance wise the program takes too long loading
>and unloading the PL1 modules. Is there any way to get around this?



Wed, 11 Jul 2001 03:00:00 GMT  
 Cobol calling PL1
There is no way to change the PL1 code to COBOL...
Isn't there anything else I can do?

Thanks
Fabricio

Quote:

>My advise is not to do this. We experienced many problems with this. You
>betta spend your time in translating one of them.

>>Can anybody post an example of a Cobol program calling a PL1 program?
>>I'm able to do that but performance wise the program takes too long
loading
>>and unloading the PL1 modules. Is there any way to get around this?



Wed, 11 Jul 2001 03:00:00 GMT  
 Cobol calling PL1
Fabricio

It is possible, but painful. PL/I needs to build an environment,
usually this is PLISTART. You can actually call PLISTART
directly and if this is the only PL/I program it will call the main
entry point of the problem program. Multiple programs are
more difficult. Ask again to the news group, I recollect an
assembler program is required to maintain the environment.

Regards



Wed, 11 Jul 2001 03:00:00 GMT  
 Cobol calling PL1
You want to make sure that the PL/I environment once established does not get
destroyed, otherwise there is much overhead in re-reestablishing it.

This can be ensured if the main routine is a PL/I main procedure, or if a PL/I
procedure, no matter what it contains, is invoked from the main routine.

Note, however, that there must not be two concurrent PL/I environments; this
means, for example, that a COBOL program cannot call two PL/I main procedures.

For further details see:

OS PL/I V2R3 Programming Guide Document Number: SC26-4307-02
Specifically sections:

 4.4.4 Invoking PL/I Routines from COBOL or fortran

and

4.4.5 Establishing the Interlanguage Environment

Manuals can be found at:
http://ppdbooks.pok.ibm.com:80/cgi-bin/bookmgr/bookmgr.cmd/library

I hope that this helps.

John Parke

Quote:

> Hi,

>     Can anybody post an example of a Cobol program calling a PL1 program?
> I'm able to do that but performance wise the program takes too long loading
> and unloading the PL1 modules. Is there any way to get around this?

> Thanks,
> Fabricio



Wed, 11 Jul 2001 03:00:00 GMT  
 Cobol calling PL1


John's reply is right to the point.

Quote:
> You want to make sure that the PL/I environment once established does not
get
> destroyed, otherwise there is much overhead in re-reestablishing it.

It is destroyed when the program first calling a PL/I program terminates.

Quote:
> This can be ensured if the main routine is a PL/I main procedure, or if a
PL/I
> procedure, no matter what it contains, is invoked from the main routine.

So if the top-level program calls a PL/I program (however simple), the
environment will stay until this top-level program terminates.  Other calls
to PL/I programs will not, even if they are several levels down.

Quote:
> Note, however, that there must not be two concurrent PL/I environments;
this
> means, for example, that a COBOL program cannot call two PL/I main

procedures.

You should code OPTIONS(COBOL) on the entry points called from Cobol
(only).

And when using LE it is even simpler, since it is a common environment.

Gunnar.



Thu, 12 Jul 2001 03:00:00 GMT  
 Cobol calling PL1
Gunnar,

    Can this first call to a PLI program be dynamic?
    My problem is that I have a COBOL program that dinamically calls another
COBOL program to do the calls dinamically to 5 PLI programs.
    I changed my first COBOL program to call dinamically a PLI stub (to load
the PLI environment), but it still is not keeping the environment. Do I need to
make it static and include this module in the Link step?

Thanks,
Fabricio

Quote:



> John's reply is right to the point.

> > You want to make sure that the PL/I environment once established does not
> get
> > destroyed, otherwise there is much overhead in re-reestablishing it.

> It is destroyed when the program first calling a PL/I program terminates.

> > This can be ensured if the main routine is a PL/I main procedure, or if a
> PL/I
> > procedure, no matter what it contains, is invoked from the main routine.

> So if the top-level program calls a PL/I program (however simple), the
> environment will stay until this top-level program terminates.  Other calls
> to PL/I programs will not, even if they are several levels down.

> > Note, however, that there must not be two concurrent PL/I environments;
> this
> > means, for example, that a COBOL program cannot call two PL/I main
> procedures.

> You should code OPTIONS(COBOL) on the entry points called from Cobol
> (only).

> And when using LE it is even simpler, since it is a common environment.

> Gunnar.



Fri, 13 Jul 2001 03:00:00 GMT  
 Cobol calling PL1
The solution was to create a PLI STUB to call the COBOL module and that made the
magic because the PLI environment was created for the main program...

Thanks!

Quote:

> Gunnar,

>     Can this first call to a PLI program be dynamic?
>     My problem is that I have a COBOL program that dinamically calls another
> COBOL program to do the calls dinamically to 5 PLI programs.
>     I changed my first COBOL program to call dinamically a PLI stub (to load
> the PLI environment), but it still is not keeping the environment. Do I need to
> make it static and include this module in the Link step?

> Thanks,
> Fabricio




> > John's reply is right to the point.

> > > You want to make sure that the PL/I environment once established does not
> > get
> > > destroyed, otherwise there is much overhead in re-reestablishing it.

> > It is destroyed when the program first calling a PL/I program terminates.

> > > This can be ensured if the main routine is a PL/I main procedure, or if a
> > PL/I
> > > procedure, no matter what it contains, is invoked from the main routine.

> > So if the top-level program calls a PL/I program (however simple), the
> > environment will stay until this top-level program terminates.  Other calls
> > to PL/I programs will not, even if they are several levels down.

> > > Note, however, that there must not be two concurrent PL/I environments;
> > this
> > > means, for example, that a COBOL program cannot call two PL/I main
> > procedures.

> > You should code OPTIONS(COBOL) on the entry points called from Cobol
> > (only).

> > And when using LE it is even simpler, since it is a common environment.

> > Gunnar.



Sat, 14 Jul 2001 03:00:00 GMT  
 Cobol calling PL1


Quote:
> Gunnar,

>     Can this first call to a PLI program be dynamic?
>     My problem is that I have a COBOL program that dinamically calls
another
> COBOL program to do the calls dinamically to 5 PLI programs.
>     I changed my first COBOL program to call dinamically a PLI stub (to
load
> the PLI environment), but it still is not keeping the environment. Do I
need to
> make it static and include this module in the Link step?

That depends on the compiler level.  With the new compilers, which use LE,
it is OK to use dynamic call.  With the VS Cobol II it is not.

The VS Cobol II APG states:

"PL/I does not support dynamic calls to or from COBOL.

COBOL dynamic CALL statements cannot be used to call a PL/I procedure
directly.  COBOL dynamic CALL statements may be used to call COBOL
subprograms in an interlanguage environment if the following rules are
observed:

1.  If a COBOL main program calls a PL/I procedure, no dynamically called
    COBOL subprogram may call a PL/I procedure.

2.  If a dynamically called COBOL subprogram has already called a PL/I
    procedure, then that COBOL subprogram cannot dynamically call another
    COBOL subprogram that executes a call to a PL/I procedure."

The solution you described in another posting is a safe one.

Gunnar.



Sun, 15 Jul 2001 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Cobol calling PL1

2. COBOL calling C calling COBOL

3. COBOL calling C calling COBOL

4. tso rexx calls cobol calls cobol -> splat

5. PL1 for Linux / PL1 for Win95?

6. wanted: PL1 to C xlator or PL1 BNF

7. FINAL CALL FOR VOTES: comp.lang.pl1

8. *****PL1 WITH COBOL NEEDED IN CHICAGO FT*****

9. pl1 to cobol converter

10. CICS/COBOL/PL1/DB2/Y2K positions in NY,NJ

11. UK NORTH WEST - PL1/COBOL VACANCIES

12. PL1, CICS. DB2/COBOL, ANALYST/PROGRAMMER/WILTS

 

 
Powered by phpBB® Forum Software