5. OPERATION › 5.1 Operation Overview › 5.1.4 Miscellaneous Service Routines › 5.1.4.2 VCCWRITR--Record Writer Routine
5.1.4.2 VCCWRITR--Record Writer Routine
The VCCWRITR module is the VCC record writer. While it is
distributed as one physical module, it can be thought of as
two logical modules: VCCWRITR and VCCWRIT2.
Any VCC subtask that desires to write a record to a file or
to SMF calls VCCWRITR. The following parameters are passed
to it:
o The address of the DCB, if not using SMF.
o The address of the record to be written.
o The address of the VCCNTRL common work area.
o The address of a processing options switch.
For data records, the standard SMF record header is
initialized. If SMF recording was requested, it writes the
record to SMF using the SMFWTM macro. If an error occurs,
control returns to the caller with an appropriate return code
set in register 15. For messages, it extracts and prefixes
the current time to the front of the message.
For records that are to be written to a DCB, the critical
information is saved in a writer buffer, and control returns
back to the calling subtask. The VCCWRIT2 routine will
process the record at a later time. If the record to be
written exceeds 1019 characters, status information will be
saved in the buffer and the subtask will wait for VCCWRIT2 to
write the record. If no writer buffers are available,
VCCWRITR waits for .2 seconds and then tries again. The
format of the writer buffer is as follows:
For records greater than 1019 characters:
DS XL1 Processing switch:
1... .... This is a message
.1.. .... This is a data record
..1. .... Record exceeds 1019 bytes
DS XL4 Address of the DCB
DS XL4 Address of the Record
DS XL3 (unused)
DS AL4 Address of the ECB to be POSTed
DS FL4 ECB to be POSTed after write
For records less than 1020 characters:
DS XL1 Processing switch:
1... .... This is a message
.1.. .... This is a data record
DS XL4 Address of the DCB
DS XL? Record to be written
The VCCNTRL main task calls VCCWRIT2 after all its other work
is done. It scans the queue of writer buffers looking for
active ones. When it finds an active buffer, the record is
written to the correct DCB and the buffer is freed. For
records longer than 1019 characters, the subtask requesting
the write is also POSTed. If VCCWRIT2 can find no records to
write, it will wait .5 seconds and then try again. After all
records have been written and all subtasks have ended,
VCCWRIT2 returns to VCCNTRL.