FREE command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (add 7.7 message behavior)
 
(2 intermediate revisions by one other user not shown)
Line 6: Line 6:
<dd>Releases a data set, and its set of attributes (template), that was allocated by the ALLOCATE command or by specifying the data set in the JCL used to start up <var class="product">Model&nbsp;204</var>.
<dd>Releases a data set, and its set of attributes (template), that was allocated by the ALLOCATE command or by specifying the data set in the JCL used to start up <var class="product">Model&nbsp;204</var>.
</dl>
</dl>
==Syntax==
==Syntax==
<p class="syntax">FREE [DATASET] <i>name</i>
<p class="syntax">FREE [DATASET] <span class="term">name</span>
</p>
</p>
   
   
<b>Where:</b>
Where:
name is the name of the data set or template released.  
<var class="term">name</var> is the name of the data set or template released.
 
==Example 1==
==Example 1==
The following example releases a data set and template that was previously allocated as NAMEA:  
The following example releases a data set and template that was previously allocated as <code>NAMEA</code>:  
<p class="code">FREE NAMEA  
<p class="code">FREE NAMEA  
</p>
</p>
==Example 2==
==Example 2==
The ALLOCATE command in the following example allocates the data set NAMEB with a data set name of MY.DSN, and copies the attributes of the NAMEA template to the NAMEB data set. The FREE command releases the NAMEB data set and template:  
The <var>ALLOCATE</var> command in the following example allocates the data set <code>NAMEB</code> with a data set name of <code>MY.DSN</code>, and it copies the attributes of the <code>NAMEA</code> template to the <code>NAMEB</code> data set. The <var>FREE</var> command releases the <code>NAMEB</code> data set and template:  
<p class="code">ALLOCATE NAMEB LIKE NAMEA WITH DSN=MY.DSN  
<p class="code">ALLOCATE NAMEB LIKE NAMEA WITH DSN=MY.DSN  
FREE NAMEB  
FREE NAMEB  
</p>
</p>
==Usage notes==
==Usage notes==
<p>Only User 0 can free data sets with the prefix CCA. All other data sets can be freed by the system administrator. An ordinary user can release only data sets allocated with SCOPE=USER and allowed by the <var class="product">Model&nbsp;204</var> ALOCPRIV parameter.</p>
<ul>
<p>A data set can be allocated through the forms of the ALLOCATE command, the <var class="product">Model&nbsp;204</var> startup Job Control Language, or the EXEC statement. (Refer to [[ALLOCATE command|"ALLOCATE: Dynamically allocate data sets for z/OS and z/VM"]] for more information on allocation). </p>
<li>Only User 0 can free data sets with the prefix <code>CCA</code>. All other data sets can be freed by the system administrator. An ordinary user can release only data sets allocated with <code>SCOPE=USER</code> and allowed by the <var class="product">Model&nbsp;204</var> <var>ALOCPRIV</var> parameter.</li>
<p>If you release an ALLOCATE command-created data set and its template, you cannot refer to the template with the LIKE phrase of an ALLOCATE or DEFINE DATASET command until the data set is redefined by issuing ALLOCATE or DEFINE DATASET. You can refer to the released template with LIKE, however, if the data set and template are first created with DEFINE DATASET.</p>
 
<p>The FREE command can also be used with a temporary in-memory file. Issuing FREE releases the above-the-bar storage that was allocated for the file and makes the file unavailable. If you know that you will need the in-memory file in the future, then dump the file before you free it. To see how much storage an in-memory file is consuming, issue the [[MONITOR GSTORAGE command|MONITOR GSTORAGE (or MONITOR GS)]] command. The memory object and file pages are not freed if the file is physically closed.  
<li>A data set can be allocated through the forms of the <var>ALLOCATE</var> command, the <var class="product">Model&nbsp;204</var> startup Job Control Language, or the EXEC statement. (Refer to [[ALLOCATE command]] for more information on allocation.)  
For more information about creating temporary in-memory files, see [[ALLOCATE command|"ALLOCATE: Dynamically allocate data sets for z/OS and z/VM"]].</p>
<p>
<p>If a FREE command is rejected, <var class="product">Model&nbsp;204</var> displays an error message explaining why the command was not accepted. You cannot release a data set that is currently in use. </p>
If you release an <var>ALLOCATE</var> command-created data set and its template, you cannot refer to the template with the <var>LIKE</var> phrase of an <var>ALLOCATE</var> or <var>DEFINE DATASET</var> command until the data set is redefined by issuing <var>ALLOCATE</var> or <var>DEFINE DATASET</var>. You can refer to the released template with <var>LIKE</var>, however, if the data set and template are first created with <var>DEFINE DATASET</var>.</p></li>
<p>When a file is opened in deferred update mode, <var class="product">Model&nbsp;204</var> protects the file by making it impossible to free the file in that <var class="product">Model&nbsp;204</var> run until all updates have been applied. All files are closed completely at the end of the <var class="product">Model&nbsp;204</var> run.</p>
 
<p>When it processes FREE, <var class="product">Model&nbsp;204</var> ends any update unit in progress and begins a non-back outable update unit. For more information about <var class="product">Model&nbsp;204</var> update units, see the <var class="book">Model&nbsp;204 File Manager's Guide</var>.</p>
<li>The <var>FREE</var> command can also be used with a temporary in-memory file. Issuing <var>FREE</var> releases the above-the-bar storage that was allocated for the file and makes the file unavailable. If you know that you will need the in-memory file in the future, then dump the file before you free it. To see how much storage an in-memory file is consuming, issue the [[MONITOR GSTORAGE command|MONITOR GSTORAGE (or MONITOR GS)]] command. The memory object and file pages are not freed if the file is physically closed.  
For more information about creating temporary in-memory files, see [[ALLOCATE command]].</li>
 
<li id="msg">If a <var>FREE</var> command is rejected, <var class="product">Model&nbsp;204</var> displays an error message explaining why the command was not accepted. If the <var>FREE</var> command is not rejected but simply takes no action (for example, the file name is incorrect), you receive an explanatory message if your version of Model&nbsp;204 is 7.7 or higher.
<p>
If a <var>FREE</var> command succeeds, you receive an explanatory message if your version of Model&nbsp;204 is 7.7 or higher. For earlier versions, no message acknowledges a successful <var>FREE</var>.</p></li>
 
<li>You cannot release a data set that is currently in use. </li>
 
<li>When a file is opened in deferred update mode, <var class="product">Model&nbsp;204</var> protects the file by making it impossible to free the file in that <var class="product">Model&nbsp;204</var> run until all updates have been applied. All files are closed completely at the end of the <var class="product">Model&nbsp;204</var> run.</li>
 
<li>When it processes <var>FREE</var>, <var class="product">Model&nbsp;204</var> ends any update unit in progress and begins a non-back outable update unit. For more information about <var class="product">Model&nbsp;204</var> update units, see [[File integrity and recovery#Update units and transactions|Update units and transactions]].</li>
</ul>
 
[[Category: System administrator commands]]
[[Category: System administrator commands]]
[[Category:Commands]]
[[Category:Commands]]

Latest revision as of 22:49, 12 September 2016

Summary

Privileges
System administrator
Function
Releases a data set, and its set of attributes (template), that was allocated by the ALLOCATE command or by specifying the data set in the JCL used to start up Model 204.

Syntax

FREE [DATASET] name

Where: name is the name of the data set or template released.

Example 1

The following example releases a data set and template that was previously allocated as NAMEA:

FREE NAMEA

Example 2

The ALLOCATE command in the following example allocates the data set NAMEB with a data set name of MY.DSN, and it copies the attributes of the NAMEA template to the NAMEB data set. The FREE command releases the NAMEB data set and template:

ALLOCATE NAMEB LIKE NAMEA WITH DSN=MY.DSN FREE NAMEB

Usage notes

  • Only User 0 can free data sets with the prefix CCA. All other data sets can be freed by the system administrator. An ordinary user can release only data sets allocated with SCOPE=USER and allowed by the Model 204 ALOCPRIV parameter.
  • A data set can be allocated through the forms of the ALLOCATE command, the Model 204 startup Job Control Language, or the EXEC statement. (Refer to ALLOCATE command for more information on allocation.)

    If you release an ALLOCATE command-created data set and its template, you cannot refer to the template with the LIKE phrase of an ALLOCATE or DEFINE DATASET command until the data set is redefined by issuing ALLOCATE or DEFINE DATASET. You can refer to the released template with LIKE, however, if the data set and template are first created with DEFINE DATASET.

  • The FREE command can also be used with a temporary in-memory file. Issuing FREE releases the above-the-bar storage that was allocated for the file and makes the file unavailable. If you know that you will need the in-memory file in the future, then dump the file before you free it. To see how much storage an in-memory file is consuming, issue the MONITOR GSTORAGE (or MONITOR GS) command. The memory object and file pages are not freed if the file is physically closed. For more information about creating temporary in-memory files, see ALLOCATE command.
  • If a FREE command is rejected, Model 204 displays an error message explaining why the command was not accepted. If the FREE command is not rejected but simply takes no action (for example, the file name is incorrect), you receive an explanatory message if your version of Model 204 is 7.7 or higher.

    If a FREE command succeeds, you receive an explanatory message if your version of Model 204 is 7.7 or higher. For earlier versions, no message acknowledges a successful FREE.

  • You cannot release a data set that is currently in use.
  • When a file is opened in deferred update mode, Model 204 protects the file by making it impossible to free the file in that Model 204 run until all updates have been applied. All files are closed completely at the end of the Model 204 run.
  • When it processes FREE, Model 204 ends any update unit in progress and begins a non-back outable update unit. For more information about Model 204 update units, see Update units and transactions.