Re: Class Notes for a PL/I Course.

"Giuseppe Vitillaro giuseppe-yuD/ahkh7LvrZ44/[email protected] [H390-MVS]" <[email protected]> Wed, 9 Oct 2019 19:13:03 +0200 (CEST)
Newsgroups gmane.comp.emulators.hercules390.mvs
Message-ID <[email protected]>
On Thu, 3 Oct 2019, Bernd Oppolzer berndoppolzer-/[email protected] [H390-MVS] wrote:

> So what is done "in real word" is often the following:
>
> we use %INCLUDE files, too. This works in PL/1, even if you don't
> use the preprocessor (which is another very interesting topic;
> the PL/1 preprocessor is much more powerful than the C macro processor,
> for example).
>
> in these %INCLUDE files, we define PL/1 structures (or aggregates)
> without the structure header, that is, without the DCL and the level 1
> definition. Only level 3 or 5 ...
>
> these structure bodies are used at both sides (caller and callee).
>
> But the caller declares:
>
> DCL 1 PARM_STRUCT AUTO,
> %INCLUDE (PARMINC);;
>
> and the callee declares:
>
> DCL 1 PARM_STRUCT BASED (PARM_PTR),
> %INCLUDE (PARMINC);;
>
> and the call looks like this:
>
> CALL CALLEE (ADDR (PARM_STRUCT));
>
> that is, only parameters are passed.
>
> It is possible to pass structures, but then you will get real trouble
> with structure aggregates.

Tried your suggestion, Bernd, with PL/I (F), working
like a charm, with MACRO defined as a PARM for the
compiler.

The only glitch come from the limitation PL/I (F)
has on the PDS dataset where the include member is stored,
following the PL/I syntax

//PL1L.DDNAME DD DISP=SHR,DSN=PDSNAME
....
%INCLUDE DDNAME(MEMBER)

I like to report it, here, on the list, because
it may be a useful reference for future users
(including a returning myself ;-) ).

On the PL/I manual GC28-6594-7, page 60, a
short paragrah state that the DD card for
DDNAME should point to a PDS dataset, with
RECFM=F[B], possibly blocked, with a LRECL<=100
and a maximum BLKSIZE of 5xLRECL.

Tested with a PDS member of a dataset
RECFM=FB,LRECL=80,BLKSIZE=400, working
correcly.

By the way, a really nice way to handle data
structures in PL/I routines, which also allow
to "extend" dynamically a structure:

DCL 1 DDDESCR,
%INCLUDE INCLUDE(DDDESCR);
     2 TT CHAR(10);

if even it is needed. Thanks again for pointing
me to the right way to handle data structures,
Bernd.

It seems to work correctly with PL/I (F), at least.

Peppe.