DEFINE FILE command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (→‎Example: typo)
m (→‎Syntax: add link)
Line 15: Line 15:
<ul>  
<ul>  
<li>
<li>
<p><var class="term">name</var> is required and is the symbolic name (file synonym) assigned to the file. The name must be from one to eight characters in length. If the name is already in use as a file synonym for this copy of <var class="product">Model&nbsp;204</var>, DEFINE FILE <var class="term">name</var> gives <var class="term">name</var> a new definition.</p>
<p><var class="term">name</var> is required and is the symbolic name (file synonym) assigned to the file. The name must be from one to eight characters in length. If the name is already in use as a file synonym for this copy of <var class="product">Model&nbsp;204</var>, <code>DEFINE FILE <i>name</i></code> gives <var class="term">name</var> a new definition.</p>
<p>
For additional details about file name requirements, see the [[Creating a file#filename|CREATE FILE syntax]] discussion. </p>
</li>
</li>
   
   
<li>
<li>
<p><var>LIKE</var> is optional and gives the file synonym currently being defined the attributes of the file referred to by <var class="term">previousname</var>, where <var class="term">previousname</var> is a symbolic name that was previously defined. </p>
<p><var>LIKE</var> is optional and gives the file synonym currently being defined the attributes of the file referred to by <var class="term">previousname</var>, where <var class="term">previousname</var> is a symbolic name that was previously defined. </p>
<p> If used, <var>LIKE</var> <var class="term">previousname</var> assigns an additional file synonym, and the FILENAME and LOCATION parameters are not required.</p>
<p>
If used, <code>LIKE <i>previousname</i></code> assigns an additional file synonym, and the <var>FILENAME</var> and <var>LOCATION</var> parameters are not required.</p>
</li>
</li>
   
   
Line 28: Line 31:
   
   
<li>
<li>
<p>A <var>FILENAME</var> setting is required, if <var>LIKE previousname</var> is not specified in the definition. actualfilename is the file's name as specified in a <var class="product">Model&nbsp;204</var> CREATE FILE command on the INE node to which the file belongs. </p>
<p>A <var>FILENAME</var> setting is required, if <code>LIKE <i>previousname</i></code> is not specified in the definition. <var class="term">actualfilename</var> is the file's name as specified in a <var class="product">Model&nbsp;204</var> <var>CREATE FILE</var> command on the INE node to which the file belongs. </p>
</li>
</li>
   
   
<li>
<li>
<p><var>LOCATION</var> is required, if <var>LIKE previousname</var> is not specified in the definition. locationname refers to the location of the remote node on which the actual file resides. </p>
<p><var>LOCATION</var> is required, if <code>LIKE <i>previousname</i></code> is not specified in the definition. <var class="term">locationname</var> refers to the location of the remote node on which the actual file resides. </p>
</li>
</li>
   
   
<li>
<li>
<p>An equal sign (=) in single quotes indicates that the location is the client node, that is, the file is local. </p>
<p>An equal sign (<tt>=</tt>) in single quotes indicates that the location is the client node, that is, the file is local. </p>
<p>The location name also might be required to match a value that is specified in the DESTINATION parameter of a local (client) DEFINE PROCESS command. If the DESTINATION name is specified in processgroup-symbolic name format, locationname must match a specified symbolic name. </p>
<p>
<p>In the following example, the DEFINE PROCESS command includes: </p>
The location name also might be required to match a value that is specified in the <var>DESTINATION</var> parameter of a local (client) <var>DEFINE PROCESS</var> command. If the <var>DESTINATION</var> name is specified in processgroup-symbolic name format, <var class="term">locationname</var> must match a specified symbolic name. </p>
<p>In the following example, the <var>DEFINE PROCESS</var> command includes: </p>
<p class="code">DESTINATION=(PGRP1,BOSTON)
<p class="code">DESTINATION=(PGRP1,BOSTON)
</p>
</p>
<p>The system manager then defines a synonym for a remote file by specifying the following location name in a file definition:</p>
<p>
The system manager then defines a synonym for a remote file by specifying the following location name in a file definition:</p>
<p class="code">LOCATION=BOSTON  
<p class="code">LOCATION=BOSTON  
</p>
</p>
</li>
</li>
</ul>
</ul>


==Example==
==Example==

Revision as of 20:32, 1 July 2016

Summary

Privileges
System manager, User 0
Function
Defines a file synonym, a symbolic name for referencing a Parallel Query Option/204 remote file

Syntax

DEFINE FILE name [LIKE previousname] WITH SCOPE=SYSTEM FILENAME=actualfilename LOCATION={locationname |'='}

Where:

  • name is required and is the symbolic name (file synonym) assigned to the file. The name must be from one to eight characters in length. If the name is already in use as a file synonym for this copy of Model 204, DEFINE FILE name gives name a new definition.

    For additional details about file name requirements, see the CREATE FILE syntax discussion.

  • LIKE is optional and gives the file synonym currently being defined the attributes of the file referred to by previousname, where previousname is a symbolic name that was previously defined.

    If used, LIKE previousname assigns an additional file synonym, and the FILENAME and LOCATION parameters are not required.

  • SCOPE=SYSTEM is required and indicates that this definition is available to all users of this copy of Model 204 for the entire length of the run.

  • A FILENAME setting is required, if LIKE previousname is not specified in the definition. actualfilename is the file's name as specified in a Model 204 CREATE FILE command on the INE node to which the file belongs.

  • LOCATION is required, if LIKE previousname is not specified in the definition. locationname refers to the location of the remote node on which the actual file resides.

  • An equal sign (=) in single quotes indicates that the location is the client node, that is, the file is local.

    The location name also might be required to match a value that is specified in the DESTINATION parameter of a local (client) DEFINE PROCESS command. If the DESTINATION name is specified in processgroup-symbolic name format, locationname must match a specified symbolic name.

    In the following example, the DEFINE PROCESS command includes:

    DESTINATION=(PGRP1,BOSTON)

    The system manager then defines a synonym for a remote file by specifying the following location name in a file definition:

    LOCATION=BOSTON

Example

In the following example, DEFINE FILE specifies the synonym CARS for the file VEHICLES:

DEFINE FILE CARS WITH - SCOPE=SYSTEM - FILENAME=VEHICLES - LOCATION=BOSTON

Usage notes

Useful only for PQO users, the DEFINE FILE command maps a file synonym defined by a local user against the actual name of a local or remote file, using the location where the file resides. Once the DEFINE FILE command has been issued, local users can refer to the file using the synonym name.

Issue the DEFINE FILE command in any of the following ways:

  • In the CCAIN User 0 stream of the client copy of Model 204

  • At the user terminal (with the necessary privileges)

  • In a User Language procedure (with the necessary privileges)

You can use DEFINE FILE to define multiple synonyms for the same file, and reissue DEFINE FILE with the same name in the same Online or batch run. However, you cannot use multiple synonyms for the same file in a group or subsystem definition.

Because Model 204 maps file synonyms when the first user opens a permanent or temporary group, changes to file synonyms have no effect on permanent groups previously opened in the run or temporary groups previously opened in the session.

To redefine a file synonym for a member of an already open group, follow these steps:

  1. Issue a new DEFINE FILE command.

  2. Close the group.

  3. Delete the group.

  4. Issue a new CREATE GROUP command.

  5. Open the group again.