Temporary changes can provide greater flexibility to the application. The server makes temporary changes when the program is first establishing a path to the file by opening the file.
The ability to use the first way depends very much on which programming language you used to write the program. Some programming languages do not allow you to control the open process to any great extent. These languages do the open process more or less automatically and control what information gets passed. Other languages allow you to have greater control over the open process.
You can use the second option regardless of which programming language you use. The iSeries™ server provides override CL commands for each file type. By including override commands with the application, you can temporarily change the file description in a file that the program wants to use.
Only the application that makes the changes can see the temporary changes. The file, as seen by another application, remains unchanged. In fact, two applications can use the same file at the same time, and each can change it temporarily according to its needs. Neither application is aware the other has made a temporary change. Figure 1 and Figure 2 illustrate the permanent and temporary change processes.
Once an application establishes a connection between itself and the file by opening the file, it can then proceed to use the file for either input or output operations. In the case of a database file, the open process establishes a path between the application and the actual database file. For device files, a path is established between the application and the actual device, or to a spooled file if the spooling attribute is active for the device file. In all cases, the application connects to what it wants to use, and those connections determine what input or output operations are valid. Not all operations are valid with all file types. The application must be aware of what file types it uses and then use only those operations which are valid for those types.