Previous Topic Next topic Print topic


Data-Directed Stream I/O

Data-directed stream I/O is similar to list-directed stream I/O. The difference is that with data-directed stream I/O, the actual Open PL/I program names of the data values are included in the stream file along with the values. For example, if your program contains the structure:

DECLARE 1 STRUC,
            2 NUM(2) FIXED BIN(15) INIT(255,-432), 
            2 TEXT CHAR(4) INIT('abcd');

and outputs this data with a PUT DATA statement, the characters emitted for STRUC would be:

STRUC.NUM(1)     255  STRUC.NUM(2)=   -432 STRUC.TEXT='abcd' ;

Each data value is preceded by the fully-qualified and specifically subscripted PL/I program name of that data value, as shown. The values themselves are formatted as they would be by a PUT LIST statement, except that character values are always enclosed in quotes.

Previous Topic Next topic Print topic