$Curfile: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
 
No edit summary
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<p>The $CURFILE function returns the name of the file from which the current record has been selected. If the file is remote, $CURFILE also returns the location of the file (in the form <var class="term">filename AT location</var>). $CURFILE takes no arguments. </p>
<p>
<p>You can use $CURFILE in two places:</p>
The <var>$Curfile</var> function returns the name of the file from which the current record has been selected. If the file is remote, <var>$Curfile</var> also returns the location of the file (in the form <var class="term">filename AT location</var>). <var>$Curfile</var> takes no arguments. </p>
<p>
You can use <var>$Curfile</var> in two places:</p>
<ul>
<ul>
<li>In arithmetic and PRINT specifications within a record loop </li>
<li>In arithmetic and <var>Print</var> specifications within a record loop </li>
</li>
 
<li>In an IN clause to override a default file or group in a STORE RECORD statement </li>
<li>In an <var>In</var> clause to override a default file or group in a <var>[[Data_maintenance#STORE_RECORD_statement|Store Record]]</var> statement </li>
</li>
</ul>
</ul>
<p>See [[Files, Groups, and Reference Context#$CURFILE and $UPDATE functions|$CURFILE and $UPDATE functions]] for a discussion of default files and for examples of requests using $CURFILE.       </p>
<p>
<p>You cannot use an IN clause that includes both MEMBER and $CURFILE. See [[Files, Groups, and Reference Context#IN GROUP MEMBER clause|IN GROUP MEMBER clause]] for more information about the IN GROUP MEMBER clause.  </p>
See [[Files, groups, and reference context#$Curfile and $Update functions|$Curfile and $Update functions]] for a discussion of default files and for examples of requests using <var>$Curfile</var>. </p>
<p>
You cannot use an <var>In</var> clause that includes both <var>Member</var> and <var>$Curfile</var>. See [[Files, groups, and reference context#IN GROUP MEMBER clause|IN GROUP MEMBER clause]] for more information about the <var>In Group Member</var>  clause.  </p>
==See also==
<ul>
<li>The <var>[[CURFILE parameter|CURFILE]]</var> parameter.
<p class="note"><b>Note:</b> It is recommended that you use <code>$Curfile</code> rather than <code>$View('CURFILE')</code>; in some circumstances <var>$Curfile</var> returns more accurate information than the <var>CURFILE</var> parameter.</p></li>
 
<li>The <var>[[DEFCNTX parameter|DEFCNTX]]</var> parameter (which is quite similar to the <var>CURFILE</var> parameter but provides more information and with more accuracy), and see the related <var>[[APDFCNTX parameter|APDFCNTX]]</var> parameter. </li>
 
<li>The <var>[[DEFAULT command|DEFAULT]]</var> and <var>[[OPEN FILE command|OPEN]]</var> commands, which reset the file/group context. </li>
 
<li>The <var>[[OPENC command|OPENC</var>]] command, which does <b>not</b> reset the file/group context.</li>
 
<li>The <var>[[CLOSE command|CLOSE</var>]] command, which might reset the file/group context. </li>
</ul>
 
[[Category:SOUL $functions]]
[[Category:SOUL $functions]]

Latest revision as of 15:59, 12 February 2018

The $Curfile function returns the name of the file from which the current record has been selected. If the file is remote, $Curfile also returns the location of the file (in the form filename AT location). $Curfile takes no arguments.

You can use $Curfile in two places:

  • In arithmetic and Print specifications within a record loop
  • In an In clause to override a default file or group in a Store Record statement

See $Curfile and $Update functions for a discussion of default files and for examples of requests using $Curfile.

You cannot use an In clause that includes both Member and $Curfile. See IN GROUP MEMBER clause for more information about the In Group Member clause.

See also

  • The CURFILE parameter.

    Note: It is recommended that you use $Curfile rather than $View('CURFILE'); in some circumstances $Curfile returns more accurate information than the CURFILE parameter.

  • The DEFCNTX parameter (which is quite similar to the CURFILE parameter but provides more information and with more accuracy), and see the related APDFCNTX parameter.
  • The DEFAULT and OPEN commands, which reset the file/group context.
  • The OPENC command, which does not reset the file/group context.
  • The CLOSE command, which might reset the file/group context.