>OPTIONS(MAIN) tells nothing about register R1 (pointer to parameter
>list).
I didn't say R1, I said standard OS parameter list. It just happens to
involve R1 on MVS but does it some other way on other platforms where
PL/1 is supported.
>PL1 program that has not OPTIONS(MAIN) expects that PL1 environment is
>initialized: R12 points to control block CAA (Common Anchor Area)
>(decribed in LE manuals), formerly called TCA (Task Communication Area)
>(desribed in PL1 V2R3 Logic manual)
You basically say that without the MAIN option, PL/1 expects the runtime
environment to be set up and parameters to be in the PL/1 format (using
decriptors in some cases). I agree.
But isn't it true that with the MAIN option, PL/1 expects the oposite:
Environment not set up and parameter list not conforming to PL/1 internal
rules since it might be a non-PL/1 program (e.g. the OS) calling the MAIN
routine? Well, I thought so but going back to the OS PL/1 V2R3 manual I
learnt I was wrong.
The following two excerpts are from the OS PL/1 V2R3 Language Reference
seem to support my understanding:
9.1.3.1.2 ENTRY Statement
MAIN The PL/I procedure is the initial procedure of a PL/I
program. The operating-system control program invokes it
as the first step in the execution of that program.
9.1.9 Passing an Argument to the Main Procedure
ENTRY statements for the main procedure can have parameter lists.
Such parameters require no special considerations in PL/I.
When the invoking program is the operating system or subsystems
supported by PL/I, a single argument is passed to the program.
...
If this facility is used, the parameter must be declared as a
VARYING character string.
When NOEXECOPS is specified, the MAIN procedure can have one of the
following as parameters:
A single parameter that is a VARYING CHARACTER string.
The parameter passes as is, and a descriptor is set up.
Other parameters (such as, more than one parameter or a single
parameter that is not a VARYING CHARACTER string). The parameter
list passes as is, and no descriptors are set up. The caller
of the PL/I MAIN procedure must know what is expected by the
procedure, including any required descriptors.
So the runtime initialization seems to build a descriptor when there is
exactly one CHAR VAR but is expecting the descriptors to be there when
the single parm is not CHAR VAR or more than one parameter is on the list.
The BYADDR option in Enterprise PL/1 would be a solution (Yeah, I read
you're on OS PL/1, this is why I had a look at that version of the
manual).
The net seems to be you can't pass more that one argument from REXX to
PL/1 at the OS PL/1 V2R3 level.
Peter Hunkeler
Senior IT Specialist, IBM zSeries Technical Sales Support, Switzerland
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html