Print Files - Work Files

Print files and work files are data containers for permanent or intermediate storage of data processed in Natural objects. These data containers are, for example, physical sequential files, members of partitioned data sets or tape data sets provided by either the operating system or the TP monitor. Natural accesses print files and work files sequentially.

A print file is used to store report data and printer control characters required to output a report on a printer.

A work file is used to store data that can be exchanged between Natural objects or between a Natural object and an object written in another programming language such as COBOL.

Print files and work files can be used for batch or online processing following the conventions of the operating system or TP monitor installed.

The section below contains information on:


Transferring Objects with Work Files

The diagram below illustrates how data contained in a work file can be used to transfer Natural objects between different Natural environments on different platforms. This is done by using a Natural utility (for example, the Object Handler) that unloads objects in the source environment into a work file and loads them from the work file into the target environment. If required, an application protocol such as FTP is used for transferring work files from source to target environments.

Defining and Accessing Print and Work Files

Print files and work files are logically defined for a Natural environment and can be physically assigned to a file or a printer by using a Natural parameter and/or control statements of the underlying operating system or TP monitor. Assignments can be changed for the current session during runtime.

Data is written to and read from a work file or written to a print file by using the appropriate Natural statements.