When a given task equation list, compiler task equation list, task declaration, or task assignment statement includes two or more file equations that apply to the same internal file, the WFL compiler uses the following rules to decide which of the specified file attribute assignments to use. These rules differ according to whether the intname used is an identifier or a string primary.
If the intname used is an identifier, then the following rules apply:
-
If a file equation includes an asterisk (*) before the file attribute assignments, then its file attribute assignments are merged with any that have been specified for the file in a previous file equation.
-
If a file equation does not include the asterisk, all task attribute assignments specified in previous file equations are discarded, and only the ones given in the latest file equation are used.
If the intname used is a string primary, then the following rules apply:
-
The file equation cannot contain an asterisk; if it does, a syntax error is given.
-
If the string primary evaluates to the same internal file name as was specified in a previous task equation, a run-time error is given.
Examples
In the following example, X1 is an identifier that specifies an intname. Because the second file equation contains no asterisk, the first file equation is discarded, and the values specified for the KIND and TITLE attributes are not used.
RUN (FOLKS)OBJECT/FREELOAD; FILE X1(KIND=DISK,TITLE=TEST/X1); FILE X1(MAXRECSIZE=20,UNITS=CHARACTERS);
In the following example, X1 is still an identifier that specifies an intname. However, because the second file equation includes the asterisk, the attributes from both file equations are merged:
RUN (FOLKS)OBJECT/FREELOAD; FILE X1(KIND=DISK); FILE X1(*,TITLE=TEST/X1);