Page 1 of 1

how to call a PL/1 *FUNCTION* from rexx?

PostPosted: Thu Nov 10, 2011 3:34 pm
by lostcontinent
hi to all,
I know how to call a PL/1 prom a loadlib, eg.
address tso
"call 'MY.LOADLIB(TEST)' '/"parm"'"

and read the result from a file that was written by the PL/1-module.

But how do I invoke a call to a PL/1-funktion?
PL1FCT: PROC(PRM) RETURNS(CHAR(10));
  DCL PRM CHAR(255);
  DCL RES CHAR(10) INIT('');
  /* do something */
  RETURN(RES);
END PL1FCT;


How does the call to PL1FCT from REXX has to look like?
I want to store the result in a rexx variable.

lc

Re: how to call a PL/1 *FUNCTION* from rexx?

PostPosted: Thu Nov 10, 2011 5:51 pm
by lostcontinent
could you please give me a hint: which FM? (earlier post deleted)

I found nothing in TSO Command reference, TSO/REXX User Guide and TSO/REXX Reference
(or did at least not know the keywords to search for, I was looking for "pl/1")
thanks,
lc

Re: how to call a PL/1 *FUNCTION* from rexx?

PostPosted: Thu Nov 10, 2011 7:38 pm
by MrSpock
From what I know, your best bet will be to look at the ADDRESS LINKPGM command, since it's supposed to be able to handle a call to any program that uses standard linkage functions. However, I read some topics in my search that mention that PL/1 doesn't follow those standards.

I don't know where your exec will ultimately run, but have you considered maybe using the ISPF Variable Pool as a way to exchange data between your programs (i.e. using the ISPF VPUT and VGET Services), or using temporary VIO datasets?