Work files are used to facilitate processing.
Decide whether the work file will be required just for the job in hand (for example, for a print program), or whether it must exist from job to job (for example, a batch entry work file). In the first case, it will probably be best to create a copy of the file in QTEMP, while in the latter case, it would be better to use a work member within a permanent file.
Consider the recovery and cleanup implications. Can the work file be thrown away or not?
Work files can be useful for reducing the number of database accesses required to interrogate the database, especially where data is to be selected on one access key but ordered on another. The method is not so much to use them as sort files, but rather to provide project and/or join operations that simplify programming. Records can be extracted from the database using the most efficient existing logical view (the OS/400 Copy file (CPYF) command is often sufficient to make the extraction). A logical file may then be built upon the extracted data, and the data presented, using a simple report program.
|
Copyright © 2014 CA.
All rights reserved.
|
|