Open (Dataset function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:Dataset:Open subtitle}}
This function opens the dataset associated with a <var>Dataset</var> object.
This function opens the dataset associated with a <var>Dataset</var> object.
==Open syntax==
==Syntax==
<p class="pre"> [%returnCode =] %dataset:open
{{Template:Dataset:Open syntax}}
</p>
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%returnCode</th>
<tr><th>%rc</th>
<td>A variable to receive the return code from the <var>[[Open (Ddataset function)|Open]]</var> method, indicating
<td>A variable to receive the return code from the <var>Open</var> method, indicating whether or not the open succeeded.
whether or not the open succeeded.
Possible return codes are:
Possible return codes are:
<dl>
<table class="noVar">
<dt>0
<tr><th>0</th>
<dd>Open is successful.
<td>Open is successful.</td></tr>
<dt>1
 
<dd>Generic failure.
<tr><th>1
<td>Generic failure.
One likely cause of this is that another user has the dataset open, currently.
One likely cause of this is that another user has the dataset open, currently.
<dt>3
 
<dd>Stream or dataset not defined, or access not allowed.
<tr><th>3</th>
<dt>14
<td>Stream or dataset not defined, or access not allowed.</td></tr>
<dd>Insufficient virtual storage for buffers or control blocks.
 
<dt>15
<tr><th>14</th>
<dd>Parallel stream has incompatible parallel members.
<td>Insufficient virtual storage for buffers or control blocks.</td></tr>
 
</dl>
<tr><th>15</th>
</td></tr>
<td>Parallel stream has incompatible parallel members.</td></tr>
<tr><th>%dataset</th>
</table></td></tr>
<td>A variable containing a reference to a <var>Dataset</var> object for which the
 
underlying dataset is to be opened.
<tr><th>dataset</th>
<td>A variable containing a reference to a <var>Dataset</var> object for which the underlying dataset is to be opened.</td></tr>
</td></tr></table>
</table>
==Usage Notes==
 
==Usage notes==
<ul>
<ul>
<li>An <var>Open</var> can modify the <var>BlockSize</var>, <var>RecordLength</var>, <var>RecordFormat</var>, or
<li>An <var>Open</var> can modify the <var>BlockSize</var>, <var>RecordLength</var>, <var>RecordFormat</var>, or
Line 36: Line 38:
from the DSCB (or CMS or VSE equivalents) will tend to override attributes
from the DSCB (or CMS or VSE equivalents) will tend to override attributes
set explicitly before the open.
set explicitly before the open.
<li>An open of a dataset or stream usually places an exclusive lock on the
<li>An <var>Open</var> of a dataset or stream usually places an exclusive lock on the
dataset or stream until it is closed.
dataset or stream until it is closed.
This means no other thread can access the dataset while it is opened.
This means no other thread can access the dataset while it is opened.
</ul>
</ul>
==See also==
{{Template:Dataset:Open footer}}

Latest revision as of 22:37, 14 November 2012

Open this dataset (Dataset class)


This function opens the dataset associated with a Dataset object.

Syntax

[%rc =] dataset:Open

Syntax terms

%rc A variable to receive the return code from the Open method, indicating whether or not the open succeeded.

Possible return codes are:

0 Open is successful.
1 Generic failure.

One likely cause of this is that another user has the dataset open, currently.

3 Stream or dataset not defined, or access not allowed.
14 Insufficient virtual storage for buffers or control blocks.
15 Parallel stream has incompatible parallel members.
dataset A variable containing a reference to a Dataset object for which the underlying dataset is to be opened.

Usage notes

  • An Open can modify the BlockSize, RecordLength, RecordFormat, or NumberOfBuffers properties. This is especially likely for input datasets where the dataset attributes from the DSCB (or CMS or VSE equivalents) will tend to override attributes set explicitly before the open.
  • An Open of a dataset or stream usually places an exclusive lock on the dataset or stream until it is closed. This means no other thread can access the dataset while it is opened.

See also