11 6 Other File Opening Considerations

LANSA Application Design

11.6 Other File Opening Considerations

By default, all RDML functions attempt to "overlap" the first user/screen interaction with a mass opening of all the databases files which will be used by the function. In other words, while the user is working with the first screen, a concurrent open of the database is being performed. Effectively, this technique is designed to reduce the user's perceived response time.

Although this approach always works, in some situations it does not perform the required action in the best possible way. For example, some of the situations where this action may not be the best result are:

  • When not all the files in the program need to be constantly open.

    A classic example of this is the report programs described in the previous section. Structurally, these report programs look something like this:

<< if running online >> 

        get report parameters and submit report job 

<< else >>

        produce required report using report parameters 

<< endif >>

In the above case, obviously no database files whatsoever are required when the job is running online. Only when the job is running in batch and the report is being produced are the database files needed.

Performance of the online portion of this program (and any other program that does not need to keep open all its files) may be considerably improved by inserting this command which states that database files should only be opened when they are used (ie: on demand):

                  OPEN FILE(*ALL) USE_OPTION(*ONDEMAND)

 

  • When the program is communicating to devices via a slow communications link.

    Since LANSA attempts to overlap file opens with the first screen I/O it cannot effectively utilize the DFRWRT (defer write) parameter of the CRTDSPF (Create display file) command.

    This parameter and command are part of the IBM i operating system. You should refer to the appropriate IBM supplied manual for exact details of this command and the impact of the DFRWRT parameter on remote communication performance.

    If an RDML function contains the command:

 

                OPEN FILE(*ALL) USE_OPTION(*ONDEMAND)

then the RDML compiler will decide that there is never any need to overlap file opens with the first screen I/O, and will thus use DFRWRT(*YES) when creating the associated screen display file. This should improve perceived response time for remote users and reduce the overall system load of the program.