WriteRecord (Dataset subroutine): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Template:Dataset:WriteRecord subtitle}} | {{Template:Dataset:WriteRecord subtitle}} | ||
==Syntax== | ==Syntax== | ||
{{Template:Dataset:WriteRecord syntax}} | {{Template:Dataset:WriteRecord syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th> | <tr><th>dataset</th> | ||
<td>A | <td>A reference to an instance of a <var>Dataset</var> object. | ||
</td></tr> | </td></tr> | ||
<tr><th> | <tr><th>string</th> | ||
<td>A | <td>A string or [[Longstrings|longstring]] variable that contains the records to be written. | ||
</td></tr> | |||
</td></tr></table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul> |
Revision as of 22:40, 20 May 2011
Write a record to this dataset (Dataset class)
Syntax
dataset:WriteRecord( string) Throws WriteError
Syntax terms
dataset | A reference to an instance of a Dataset object. |
---|---|
string | A string or longstring variable that contains the records to be written. |
Usage notes
- To use the WriteRecord method, the Dataset object must be an output object, that is, its Output) value must be True. . Using WriteRecord against an input dataset results in request cancellation.
- The Dataset object must be in the Open state to use the WriteRecord method. Using WriteRecord against a dataset in the Closed or Full state results in request cancellation.
- If a WriteRecord method is used after a WriteRecord method, the block containing the record written by the preceding WriteRecord is written, if it has not already been written.
- For F and FB format files, the output string written by WriteRecord must be shorter than or equal in length to the value of RecordLength). Records shorter than the RecordLength value are padded with blanks so their length exactly equals the RecordLength. Output strings that are too long result in request cancellation.
- For V and VB format files, the output string written by WriteRecord must be shorter than or equal in length to the RecordLength value minus four. Four is subtracted because the WriteRecord method adds the required RDW before the record. This is true even under CMS, where records are not really stored on disks with BDWs and RDWs — they are mapped from the MVS format to the CMS format by BSAM simulation. Output strings that are too long result in request cancellation.
- If there is no more room for a WriteRecord in a file, the dataset switches from the Open to the Full state. After this, a WriteRecord or WriteBlock results in request cancellation.
- Since WriteRecord blocks the data before writing it, WriteRecord usually
returns before the data has actually been written to disk.
As such, it is possible that data written by a previous WriteRecord might
not have actually been written to disk, either because of an I/O error or,
more likely, because the file filled.
See also