Re: Class Notes for a PL/I Course.

"Giuseppe Vitillaro giuseppe-yuD/ahkh7LvrZ44/[email protected] [H390-MVS]" <[email protected]> Sat, 5 Oct 2019 11:46:38 +0200 (CEST)
Newsgroups gmane.comp.emulators.hercules390.mvs
Message-ID <[email protected]>
On Sat, 5 Oct 2019, kerravon86-/[email protected] [H390-MVS] wrote:

> ---In [email protected], <giuseppe@...> wrote :

> > > Am I right betting a variable length dataset can't have a zero length
> > records?
> > I haven't worked with VS datasets, but I know that regular V[B] datasets
> > can have records with zero length. (At least in MVS, yes; in VM/CMS, no.)

> Ouch. Thanks.

> But I bet that if I use 0xFFFF for logical EOF I'm on
> the safe side?

The RDW will be a minimum of 4 or 5. So you can
use an RDW of 0 to indicate EOF, which is what
COPYFILE will do if you do a binary copy of a
RECFM=VB to RECFM=FB.

An RDW of 4 is a zero-length record. There's
no concept of an RDW of 0. The RDW is the
length of the data plus 4 bytes for the RDW
itself, so logically has to be a bare minimum
of 4.

BFN. Paul.

---

Paul, I do not have access to RDW in PL/I.

What I've is:

READ FILE(VBDS) INTO(BUF);
L = LENGTH(BUF);

and if L may be zero, I can't use 0x0000
as a logical EOF when packing into an
FB[80] dataset the record.

When I read back the VS records from the FB
dataset what I can do is (remember SP is
actually reading record length back in L):

GET FILE(FBDS) EDIT ( SP ) ( A(2) );
GET FILE(FBDS) EDIT ( BUF ) ( A(L) );

and, again. if L can be zero, I'm in trouble.

Now, the question is, may L be zero in PL/I
when reading a variable record length dataset
under MVS?

If I got it correctly, L can't be greater than 32760,
so 32767 can be a correct a choice?

Peppe.