MV.OPEN.FILE Function  
Previous  Top  Next

Description  
 
This routine will open the file name contained in the variable Filename and return the opened file variable in FileVar. If there was an error it will be returned in the variable Error.  

Syntax  
 
MV.OPEN.FILE (Filename, FileVar, Error)  
 
Variable
Description of how the variable is used
Ranges
Filename
The file name to be opened and type of file
Any valid file.

Attribute 1 is the file name


Attribute 2 is "1" if the file is an indirect file i.e. the file name in attribute 1 is formatted

FileVar
The opened file variable is returned in FileVar

Error
Returns as 0 (zero) file opened, 1 (one) cannot open.

 


This uses NC.OPENFL to perform the task; therefore the same features apply, i.e.  

An indirect file is a file in another account but the file is not referenced as a q-pointer in the current account. The file name must therefore be formatted:  
 
·Account Name followed with a comma then the File Name.  

The file is opened into the COMMON area NCFL (xx) where xx is the number in the array that is returned in the variable Param.  
 
The file name is stored in the COMMON variable NCMFL (3)<1,xx>.  
 
There are a few special cases and validations performed:  
 
The record called SYSTEM in the file _CONTROL can be used to "lock" whole files for processes performed within OSMOSiS only. Attribute 2 in the record contains a list of the files that are locked. If a file open is attempted with NC.OPENFL and the file is locked by this method it will return the error:  

·"fff : File is LOCKED at the moment please wait!" where fff is the file name.  


· If the file name is "fff ,?" where fff is a valid file and the "?" signifies that the "shared" file is to be entered by the operator.  


The routine will request:  

·"Enter File Name:"  

The file name entered will be attached to the "fff," and the shared file will be opened in the normal way. The entered file name is returned in PARAMS (3).  
 
document Remarks  

prcarrow Be careful not to affect one of NCFL without the corresponding NCMFL (3)