Dynamically Calling Programs from PL/I 
Author Message
 Dynamically Calling Programs from PL/I

Quote:

>Hello:

>My client wants to do a dynamic call of an ASSEMBLER
>program from PL/I [...]
>The compile step completes with CC 0
>The link step returns CC 8 and the message

>IEW2456E 9207 SYMBOL TSSAI UNRESOLVED.  MEMBER COULD NOT BE
>INCLUDED FROM THE DESIGNATED CALL LIBRARY.

There must be a FETCH of the module somewhere for PL/I to know that the module
is to be dynamically loaded.

Unfortunately, there is no [FETCHED] option on the entry declaration to do
this. If you have a canned declaration that's %included, use the line
        if '0'b then fetch(module);
to supply the "option" in the included text.

And finally of course, the required module must be on the default search path
for executables, your STEPLIB, etc to be found at run time. The linker doesn't
care.

Oops, one thing more. There may be a mismatch between addressing modes...
While PL/I will generate a thunk to make the addressing mode switch during
the call, it doesn't help when it comes to addressing of parameters. If the
fetched module expects parameters below the 16M line, run the fetching program
below the line or make the parameters AUTOMATIC (the stack being below the
line).

Bernie

--

Member: Ontario DX Association, Tsuruoka Canadian Budokai
--



Mon, 08 Feb 1999 03:00:00 GMT  
 Dynamically Calling Programs from PL/I

Quote:

> Hello:

> My client wants to do a dynamic call of an ASSEMBLER
> program from PL/I -- her inital code contains:

> DCL                                          
>    TSSAI OPTIONS(ASM INTER RETCODE) ENTRY(*);

We have a very old(pre XA) assembler interface routine
that is statically linked but does a LOAD of a second
assembler routine, which is actually preloaded.

We don't actually execute the dynamically called program,
we just use the EPLOC as a starting point for a table lookup.

There may be better Macros to use, eg. BLDL?
--
notice: by sending advertising/solicitations to this account you will be
indicating your consent to paying me $70/hour for a minimum of 2 hours for
my time spent dealing with it



Mon, 08 Feb 1999 03:00:00 GMT  
 Dynamically Calling Programs from PL/I


        >Hello:

        >My client wants to do a dynamic call of an ASSEMBLER
        >program from PL/I -- her inital code contains:

        >DCL                                          
        >   TSSAI OPTIONS(ASM INTER RETCODE) ENTRY(*);
        >.                                              
        > CALL TSSAI(TSSCPL);
        >The compile step completes with CC 0
        >The link step returns CC 8 and the message

        >IEW2456E 9207 SYMBOL TSSAI UNRESOLVED.  MEMBER COULD NOT BE
        >INCLUDED FROM THE DESIGNATED CALL LIBRARY.

        >It seems that PL/I still considers this a static call.
        >I tried some code changes:

        > DCL                                            
        >   TSSAI  EXTERNAL ENTRY() OPTIONS(ASM INTER);  
        >.
        >CALL TSSAI(TSSCPL);

        >I get the same message at link edit. No matter what I
        >try, the linkage editor wants the module. How do I tell PL/I
        >that I want to do a dynamic call of a module?  


---My (old) manual says that FETCH and RELEASE
statements must be used to gain access to a dynamically
loaded procedure.

   In any case, wouldn't the linker still have to know about
the fetched procedure?  I.E., wouldn't the linker still
have to have access to the library where the assembler
routine is found?  (just guessing . . . manual here might
be quite out of date . . .)



Mon, 08 Feb 1999 03:00:00 GMT  
 Dynamically Calling Programs from PL/I


 >I get the same message at link edit. No matter what I
 >try, the linkage editor wants the module. How do I tell PL/I
 >that I want to do a dynamic call of a module?  

Have you tried including a FETCH statement in your program somewhere?

---
The above are my own opinions, and not those of my employer.



Mon, 08 Feb 1999 03:00:00 GMT  
 Dynamically Calling Programs from PL/I



 >---My (old) manual says that FETCH and RELEASE
 >statements must be used to gain access to a dynamically
 >loaded procedure.

Yep.

I believe the presence of a FETCH statement tells PL/I that the module is
dynamic, and that even if the module hasn't been FETCHed it will be if a
call is made.

I wonder why they didn't put a DYNAMIC keyword in the OPTIONS for the entry
declare.

 >   In any case, wouldn't the linker still have to know about
 >the fetched procedure?  I.E., wouldn't the linker still
 >have to have access to the library where the assembler
 >routine is found?  (just guessing . . . manual here might
 >be quite out of date . . .)

Nope.

As there's a FETCH and RELEASE statement, I'd imagine it uses (on MVS
anyhow) a LOAD SVC to load the module.

There's really no reason to tell the Linkage Editor (or is it Binder now)
about it.

---
The above are my own opinions, and not those of my employer.



Mon, 08 Feb 1999 03:00:00 GMT  
 Dynamically Calling Programs from PL/I


 >The calling PL/I program relies on the called ASSEMBLER program to pass
 >back a data structure, say:        
 >
 > DCL 1 STRUCT,
 >       2 A  CHAR(20),
 >       2 B  FIXED BINARY(31);
 >.
 >.
 > CALL TSSAI(STRUCT);
 >
 >If the called module is FETCHed, how will it know the address of STRUCT?

The address of the structure is passed to the assembler routine in an
address list pointed to by register 1.

---
The above are my own opinions, and not those of my employer.



Fri, 12 Feb 1999 03:00:00 GMT  
 Dynamically Calling Programs from PL/I



Quote:

>INCLUDED FROM THE DESIGNATED CALL LIBRARY.

>It seems that PL/I still considers this a static call.

> DCL                                            
>   TSSAI  EXTERNAL ENTRY() OPTIONS(ASM INTER);  
>..
>..
>..
>CALL TSSAI(TSSCPL);

>How do I tell PL/I
>that I want to do a dynamic call of a module?  

You need to use the FETCH and RELEASE statements, like so:

DCL  TSSAI  EXTERNAL ENTRY() OPTIONS(ASM INTER);  
.
.
FETCH   TSSAI;
CALL    TSSAI(TSSCPL);
RELEASE TSSAI;

These statements are described in more detail in the IBM PL/I
Language Reference manual and the IBM PL/I Programmer's Guide
(I refer to the MVS version of PL/I... I'm not sure about the
other versions - OS/2, WinNT, etc.)



Mon, 15 Feb 1999 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Dynamically Calling Programs from PL/I

2. Trying to dynamically call Cobol subroutine from PL/I.

3. Calling a COBOL program from a PL/1 program

4. Calling a COBOL program from a PL/1 program

5. Dynamically called VI's meet VISA sessions / programming books

6. Need help on PL/I called program

7. Cobol calling Pl/1 program

8. dynamically call a procedure WITH parameters in another dll

9. Dynamically change called procedure

10. Dynamically calling sub-vi's

11. error is generated when a vi is called dynamically in exe

12. Dynamically calling IVI driver VIs

 

 
Powered by phpBB® Forum Software