Working-Storage Files
A file with a working-storage specification can be used to enter data, perform edit checks and computations, and execute statements without actually storing data. This type of file provides you with the equivalent of work fields that can be grouped in a record format. It may be beneficial to use this storage-type when dealing with a group field, such as a general ledger account number with distinct but related subparts.
These files are often used in record comparisons. You create a work record that contains the same fields as the disk-based record and, using a group field that includes the entire record, copy the contents of the disk record into the work record with a single statement. You can then compare this stored record with another record from the disk file.
Calculator functions are another example of the use for this type of file. You could use a working-storage file-type to receive principal and interest rate data, and compute and display a monthly payment amount. Users could re-enter different values, and the computation and display can be performed as often as necessary without saving the entered or calculated information.
Working-storage fields have a SUBPROCESS scope. They can be shared between a process and its subprocesses.