Re: Class Notes for a PL/I Course.
"Giuseppe Vitillaro giuseppe-yuD/ahkh7LvrZ44/[email protected] [H390-MVS]" <[email protected]> Sat, 5 Oct 2019 18:47:37 +0200 (CEST)
| Newsgroups | gmane.comp.emulators.hercules390.mvs |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 5 Oct 2019, Bernd Oppolzer berndoppolzer-/[email protected] [H390-MVS] wrote: > Hi Peppe, > > when I recall your PL/1 coding right, you are not storing RDWs in your FB80 > file, > but instead you are storing the net record length returned by the PL/1 > runtime system > (the varchar length). This is IMO always RDW minus 4. > > On the other side (when writing), you use this length again to write VS > records; > PL/1 translates the length to RDWs etc. (that is, it adds 4 again). > > I guess, RDWs are always positive, so the value returned by PL/1 will always > be > in the range 0 to 32763 (0x7fff minus 4), maybe the upper bound is even lower > .... BTW: you should take special care for the zero case (don't do the PUT > EDIT > and GET EDIT for the buffer in this case, but - on output - > write the zero length VS record). Yep, Bernd, I had already been caught, thanks for the advice. > > But: because real lengths will always be between between 0 and 32763, > it is IMO safe for you to store a "fake length" of minus one (0xffff) as an > EOF mark. > > Kind regards > > Bernd Yep, that is, 0xFFFF is the correct logical EOF, to be used in this packing. It can be there "if and only if" VS2FB PUT it into the STREAM and "if and only if" it is not a length of any record of the original variable length dataset. I don't think I've to care if it is a V,VS,VB,VSB input dataset, actually, the PL/I runtime library take care of the differences, calling the MVS access methods in the correct way and sequence, I bet. Did I say, as a guy with a math background, how much I love, and hate at the same time, wording "if and only if"? ;-) By the way. I realized I was using OPT(1), the PL/I (F) default, for my tests with VS2FB and FB2VS. With OPT(2) it is a little bit faster, I think, not sure, it is just a feeling, I still have to benchmark the difference. Probably it is just a feeling, I can't understand what really can be optimized in so simple I/O loops, basically spending most of the time inside the PL/I runtime library. Peppe.