Query Files


Query files consist of a process control file (PCF), three temporary files, a pointer file, and an optional alternate control file.

·    Process control files are mandatory for queries; they govern the execution of a query by identifying the file that contains the records to be constrained and/or sorted.

·    Queries populate three temporary files at the end of setup. QSLCT maintains selection constraints, QPARM maintains selection expressions, and QSORT stores sort fields. These temporary files are populated based on the sort and selection criteria established for the query in application design, and adjusted by the application user during query setup. The contents of these files determine the records from the PCF that are available to any process using the query.

·    During execution, the query process creates a pointer file, which includes the keys to all records that satisfy the selection criteria, in the order that is designated by the sort.

Once the temporary files and the pointer file are populated, the query is referred to as active. In general, a query remains active throughout the execution of a subprocess family or a related process family. When a process that was invoked as detached ends, any queries within its scope automatically end.

This permits you to have more than one query active at any time, and to use the same query with more than one process in a family, as shown in the Figure 3-2-11.

Generate/3-02_query_files.gif

Figure 3-2-11. A Process Tree with Multiple Potentially Active Queries