4 9 1 Making a File Operational

Visual LANSA

4.9.1 Making a File Operational

In LANSA, making a file operational may involve three different tasks in the following order:

  • creating a physical file
  • creating logical files over a physical file
  • creating an OAM (Object Access Module or I/O module)

When a file is first defined, it must be made operational and all three tasks are to be performed, (assuming there are logical files), by either you or LANSA.

If you change your field definitions or your file definitions in the repository, you may need to perform some or all of the above tasks as you make the files operational once more. All three tasks do not always have to be performed. For example, adding a validation check will not require recompiling the physical or logical files. (Refer to 4.9.3 What to Recompile.)

In most circumstances, LANSA will check which of the three tasks needs to be performed; however, LANSA cannot detect all changes made at the field level.  For example, if you change a default value for a field on a file, you should use impact analysis and then tell LANSA to recompile the OAM when you make the file operational.  If you changed a field's length, LANSA will know to perform all three tasks of rebuilding files, logical views and OAM. (Refer to 4.9.4 When To Recompile.)

Making files operational is an excellent example of how LANSA shields developers from the underlying technical layers of the database and operating system. Under IBM i, making files operational will create physical and logical files. Under Windows, making files operational will create SQL tables in the appropriate database manager.

To make a file operational, use the Compile File option. The Compile Option dialog will appear. This dialog allows you to specify which tasks should be performed when the file is made operational.

Using the Compile File only if Necessary option, LANSA will check if the file compile needs to be performed; however, LANSA cannot detect all changes made at the field level. For example, if you change a field level rule for a field in the file, you must tell LANSA to recompile the OAM when you make the file operational.  If you changed a field's length, LANSA will know to recompile the file.

When a file is recompiled, you have the option to save and reload and existing data in the table. The types of changes to your table will determine how much of the data can be restored. (Refer to 4.9.2 What about Data?.)

You do not need to keep the generated source code unless you are planning to move your application to another platform which requires the C code (for example, Linux).

Also See

File Compile Options in the Technical Reference Guide

Ý 4.9 Compiling Files