Version 4.2.6 for Mainframes
 —  Operations  —

Print File and Work File Support

This document describes special considerations on how to use print files and work files in Natural for VM/CMS.

The following topics are covered:


Defining Print Files and Work Files

Print files and work files are defined in the Natural parameter module with the macros NTPRINT and NTWORK. The corresponding dynamic parameters are PRINT and WORK.

In the following, the subparameters AM (access method) and DEST (destination) are described: They are available both in NTPRINT and NTWORK.

For both print and work files, Natural/CMS provides two access methods: "STD" and "CMS".

Top of page

Access Method STD

(AM=STD)

This access method uses the CMS simulation of the z/OS QSAM access method. Specify AM=STD if you want to read or write tape or spool (RDR, PRT, PUN) files, or if you want to read work files from z/OS-formatted disks.

A FILEDEF command must be issued before the corresponding print or work file is opened. The DD name to be used in the FILEDEF command is the name specified in the subparameter DEST.

Top of page

Access Method CMS

(AM=CMS)

This access method uses the standard CMS file system to read and write CMS files on accessed mini disks and SFS directories.

The file names of the resulting CMS files are:

where nn denotes the number of the file.

Their file type is the same as the name specified in the subparameter DEST. The filemode is always "A1".

Special Destination Names for AM=CMS

DEST=FD Destination FD allows greater flexibility in assigning a CMS file to a Natural print or work file. When Natural opens a print or work file with destination FD, it searches for a FILEDEF for the DD name CMPRTnn or CMWKFnn, respectively (where nn denotes the print or work file number). It then uses the CMS file ID given in the FILEDEF command.
DEST=LISTING This DEST setting applies to print files only.

When specifying this destination, the print file is written to the CMS disk that has the most free space available. The CMS file ID is CMPRTnn LISTING m where m denotes the filemode of the mini disk that had the most free space.When the printer is closed, the print file is printed on the virtual printer and subsequently deleted.

DEST=UEXxxxxx

This DEST setting applies to print files only.

If you specify a destination that starts with UEX, the print file is treated as if LISTING had been specified. In addition, a CMS command of this name is issued by Natural when the printer is closed. The CMS command (for example, a Rexx procedure) receives the CMS file ID of the print file as parameter.

Examples:

Example 1:

When the following FILEDEFs and NATPARM settings are in effect

FILEDEF CMWKF05 CLEAR
FILEDEF CMPRT01 DISK MY REPORT D
FILEDEF CMPRT04 DISK MY REPORT A
NTWORK (1),AM=CMS,DEST=FRED
NTWORK (5),AM=CMS,DEST=FD
NTWORK (6),AM=CMS,DEST=PAUL
NTPRINT (1,4),AM=CMS,DEST=FD
NTPRINT (2),AM=CMS,DEST=LISTING
NTPRINT (5),AM=CMS,DEST=PAUL

the following CMS files are produced:

CMWKF01 FRED A1
FILE CMWKF05 A1
CMWKF06 PAUL A1
MY REPORT D1
MY REPORT A1
CMWKF05 PAUL A1 

The temporary file CMPRT02 LISTING m is printed and subsequently deleted (where m denotes the filemode of the minidisk that had the most free space).

Example 2:

NTPRINT (1),AM=CMS,DEST=UEXLOCAL

produces the CMS file:

CMPRT01 UEXLOCAL m

and the CMS command UEXLOCAL is issued with the file ID as parameter. If, for example, a Rexx procedure of this name exists, it can determine for which printer it was invoked by using arg fn ft fm.

Example 3:

Destinations can also be defined dynamically using the DEFINE WORK FILE statement. In addition, DEFINE WORK FILE can be used to specify input from, or output to, a Rexx stem:

        
DEFINE WORK FILE n 'STEM rexxstem.'

When opening an input file, Natural uses the value of rexxstem.0 to determine the number of records to read. It then reads records from rexxstem.1 to rexxstem.max (with max = rexxstem.0) before returning end-of-data.

For an output file, Natural writes rexxstem.1 to rexxstem.n, and sets rexxstem.0 to n when the work file is closed.

Top of page