11.5 Using the OPEN Command Instead of a Logical View to Order Data

The use of the LANSA OPEN command with the parameter USE_OPTION(*OPNQRYF) to invoke the operating system command OPNQRYF (open query file) has already been discussed in relation to the production of flexible reporting programs.

This section describes how the KEYFLD parameter can be used to alter the order in which data is processed/printed by a report program.

Another aspect of this facility relates to total system performance.

When you are going to produce a report which must be ordered in a way that does not reflect the key of any existing logical file, you basically have 2 choices:

If the report is not commonly used, and there are less than 100,000 records in the file, the second is probably the preferred alternative, mainly because: