WriteRecord (Dataset subroutine): Difference between revisions
Jump to navigation
Jump to search
m (Created page with "This subroutine writes a block of data to an output dataset. ==WriteRecord syntax== <p class="pre"> %dataset:writeRecord(%string) </p> ===Syntax terms=== <table class="syntaxTabl...") |
m (Created page with "This subroutine writes a block of data to an output dataset. ==WriteRecord syntax== <p class="pre"> %dataset:writeRecord(%string) </p> ===Syntax terms=== <table class="syntaxTabl...") |
||
Line 1: | Line 1: | ||
{{Template:Dataset:WriteRecord subtitle}} | |||
This subroutine writes a block of data to an output dataset. | This subroutine writes a block of data to an output dataset. | ||
== | ==Syntax== | ||
{{Template:Dataset:WriteRecord syntax}} | |||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
Line 12: | Line 13: | ||
</td></tr></table> | </td></tr></table> | ||
==Usage | ==Usage notes== | ||
<ul> | <ul> | ||
<li>To use the <var>WriteRecord</var> method, the <var>Dataset</var> object must be an output object, | <li>To use the <var>WriteRecord</var> method, the <var>Dataset</var> object must be an output object, | ||
Line 33: | Line 34: | ||
the record. | the record. | ||
This is true even under CMS, where records are not really stored on disks | 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 | with BDWs and RDWs &mdash; they are mapped from the MVS format to the | ||
CMS format by BSAM simulation. | CMS format by BSAM simulation. | ||
Output strings that are too long result in request cancellation. | Output strings that are too long result in request cancellation. | ||
Line 44: | Line 45: | ||
not have actually been written to disk, either because of an I/O error or, | not have actually been written to disk, either because of an I/O error or, | ||
more likely, because the file filled. | more likely, because the file filled. | ||
==See also== | |||
{{Template:Dataset:WriteRecord footer}} |
Revision as of 18:03, 20 May 2011
Write a record to this dataset (Dataset class)
This subroutine writes a block of data to an output dataset.
Syntax
dataset:WriteRecord( string) Throws WriteError
Syntax terms
%string | A string or longstring variable that contains the records to be written. |
---|---|
%dataset | A reference to an instance of a Dataset object. |
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