Peter Flass wrote:
> On 3/4/2013 11:15 PM, James J. Weinkam wrote:
>>
>> Is there some reason that you need to know the format of the DEDs? As
>> far as I know they are never visible to user written code.
>
> Unless you're calling assembler or some other language where you need to know string lengths, etc.
If I understand the interlanguage facility correctly, specification of the ASSEMBLER option prevents the passing of
descriptors. If you want the descriptor to be passed to an assembly language routine you have to let the compiler think
is is calling a PL/I routine and know how to process the argument list including any descriptors. However, the
descriptors passed in CALL statements and function references are not Data Element Descriptors. As I stated in my
previous post, DED's encode the data type and are needed for compiler generated calls to run time library routines that
are able to process data whose type is not known until the time of invocation. For example, in EDIT directed io, both
the EDIT list and the format list allow looping constructions that can depend on variables whose value are not known
until run time and can vary from one execution to another of the same statement. There is no way in general for the
compiler to match up data list entries with format list transmitting items. The simplest way for the compiler to deal
with this is to generate a data coroutine and a format coroutine. The data coroutine executes until it has a data item
ready for conversion and transmission and then resumes the format coroutine leaving pointers to the value and a DED in
known locations. The format coroutine executes from where it previously left off until it reaches a data transmitting
item; it then uses the DED to find out how to intrepret the data identified by the pointer and convert it according to
the format item in the case of output or to convert the input stream item and store it in the specified location in the
case of input; it then resumes the data coroutine. This continues until the data coroutine ends.
The DED tells the called routine the data type; in the case of ordinary procedures the data type of the parameter is
known, e.g., three dimensional array of bin float(21) or varying length character string, all the descriptor does is
provide the subscript bounds or current and maximum string lengths.