I/O Processing



This is one area where some work is done on behalf of the programmer by the provision of macros.

The principal requirements are the same in all three languages:


  • OPEN

  • GET / PUT

  • CLOSE

  • DCB - In z/VSE the DTF macro is used instead of DCB. In COBOL these are built from the SELECT statement, the FD, and the OPEN statement, whereas in PLI the details are provided via a DECLARE (DCL) statement.

Some complete programs for processing sequential data sets (files)



All programs perform the same function, which is to read one sequential file and write to another.

The READ and WRITE macros available in Assembler relate to the Basic Sequential Access Method (BSAM) which returns an entire block of data to the program on READ operations and WRITEs an entire block on output. The programmer has to handle any short blocks encountered.

QSAM MOVE Mode Examples
(QSAM - Queued Sequential Access Method)

VSAM ESDS Mode Examples
(ESDS - Entry Sequenced Data Set)

See Assembler example

See Assembler LE example

See COBOL example

See PLI Example
See Assembler example

See Assembler LE example

See COBOL example

See PLI Example


VSAM (Virtual Storage Access Method) processing uses a combination of ACB, RPL and EXLST control blocks rather than DCB/DTF.


Copyright © Legac-e Education 2015-