You need to look at FETCH and RELEASE PL/I statements.

Procedures not already in main storage are loaded from the disk.
►► FETCH ▼
,
entry-constant
SET ( ptr-ref ) TITLE ( char-expr )
►
► ; ►◄
Dynamic loading of an external procedure

entry-constant
Specifies the name by which the procedure to be fetched is known to the
operating system. Details of the linking considerations for fetchable procedures
are given in the Programming Guide.
The entry-constant must be the same as the one used in the corresponding
CALL statement, CALL option, or function reference.
SET
Specifies a pointer reference (ptr-ref) that will be set to the address of the 
entry
point of the loaded module. This option can be used to load tables
(non-executable load modules). It can also be used for entries that are fetched
and whose addresses need to be passed to non-PL/I procedures.
If the load module is later released by the RELEASE statement, and the load
module is accessed (through the pointer), unpredictable results can occur.
TITLE
For TITLE, char-expr is any character expression or an expression that can be
converted to a character expression. If TITLE is specified, the load module
name specified is searched for and loaded. If it is not specified, the load
module name used is the environment name specified in the EXTERNAL
attribute for the variable (if present) or the entry constant name itself.
See the following example:
dcl A entry;
dcl B entry ext(’C’);
dcl T char(20) varying;
T = ’Y’;
fetch A title(’X’); /* X is loaded */
fetch A; /* A is loaded */
fetch B title(’Y’); /* Y is loaded */
fetch B; /* C is loaded */
fetch B title(T); /* Y is loaded */
For more detailed information about title strings, refer to the Programming
Guide.

"Phil Smith III" <li...@akphs.com> wrote in message news:006f01d83d71$24409280$6cc1b780$@akphs.com...
I have a function that can be statically or dynamically linked. Currently
the function definition in an include file is [something like]:

  Declare SOMEFN External('SOMEFN') Entry(

           Char(*) byaddr,

          )

          returns( byvalue Fixed Bin(31) )

          options ( nodescriptor, linkage(system) );



User wants to link dynamically, says this doesn't work. It appears I could
add FETCHABLE to the OPTIONS and then it would be dynamic, but reading also
suggests (without AFAICT making it clear) that then it can ONLY be linked
dynamically. Do I need two include files, one for dynamic link and one for
static? Or is there some more elegant way?



Ironically, PL/I was my first official programming language*, almost 47
years ago when I sat in on my dad's class at University of Waterloo the
summer after 8th grade, but it's been a minute! Plus that was on a Xerox
530**, which might not have had the same linkage editor rules as z/OS. I'd
ask him but he died in 2006.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to