[Info-vax] Whither VMS?
Jordi Guillaumes i Pons
send.me at no.spam
Sun Oct 4 15:59:46 EDT 2009
En/na glen herrmannsfeldt ha escrit:
>
> < And one of the first languages that I used that had this "length byte"
> < concept was UCSD-Pascal. Which, from the very start, included a way
> < to violate those bounds. Go figure....
>
> PL/I also usually uses length at the beginning.
>
Yup! Only for VARYING CHAR variables. On the other hand, it uses
descriptors to pass string parameters so the called procedure knows the
length of the incoming string, being it fixed-length or varying.
Of course, when you declare a VAR CHAR(1024) the compiler allocates 1026
(or 1028 in the last versions) bytes, unless you declare a BASED or
CONTROLLED variable. It's unvaluable processing varying length records:
DCL BUFFER_AREA CHAR(1024) VARYING;
DCL 01 RECORD_TYPE_1 BASED(ADDR(BUFFER_AREA)),
03 LENGTH BINARY FIXED(15),
03 DATA,
05 RECORDTYPE CHAR(2),
05...
DCL 01 RECORD_TYPE_2 BASED(ADDR(BUFFER_AREA)),
03 LENGTH BINARY FIXED(15),
03 DATA,
05 RECORDTYPE CHAR(2),
05...
The more recent versions support C-isms like UNION, so the need to do
such idioms (when you have to debug a program where one structure is
based on the address of the last byte of another structure, which is
based on a record, which is based on a POINTER, using a DUMP, you start
to wonder what in #¢¢$@ was thinking the programmer about... ;)).
Oh, by the way, I'm talking about zOS PLI compilers. I've not followed
the current status of the Kednos version vs. the last IBM PLI extensions.
(After my golden VAX days, I spent nearly 12 years coding & designing
applications for MVS-OS/390-z/OS, in PLI and against IMS/DB/DC...).
More information about the Info-vax
mailing list