PRINT - Print File Assignments

#### Search Results

Search

# PRINT - Print File Assignments

This Natural profile parameter specifies the print files to be used during the session. It corresponds to the `NTPRINT` macro in the Natural parameter module.

Possible settings | See PRINT Parameter Syntax.
Default setting | See the default values of the different keyword subparameters described below. Depending on the access method and the environment, there may be different default settings.
Dynamic specification | yes | The parameter `PRINT` can only be specified dynamically. In the Natural parameter module, use the macro `NTPRINT`.
Specification within session | no |

Notes:

1. The old dynamic parameter `PRINTER` can be used as a synonym for `PRINT`.
2. Within a session, up to 31 logical print files (numbered 1 to 31) and the hardcopy print file (Number 0) can be used.
3. The software components for accessing print files in different environments are called access methods. For the duration of a Natural session, each logical print file can be assigned to one access method only. The access method for a print file is determined by the keyword subparameter `AM`.
4. In z/OS under TSO and in batch mode, print files need not be predefined in the JCL. Provided they are defined by subparameter `AM=STD`, they can be allocated dynamically during the session in a Natural program using the `DEFINE PRINTER` statement or the application programming interface `USR2021` (in library `SYSEXT`).
5. See also Print and Work File Handling with External Data Sets in a Server Environment in the Operations documentation.

This document covers the following topics:

- PRINT Parameter Syntax

- NTPRINT Macro Syntax

- Keyword Subparameters for All Environments

- Keyword Subparameters for AM=STD in All Environments

- Keyword Subparameters for AM=STD in z/OS Environments

- Keyword Subparameters for AM=CICS

- Keyword Subparameters for AM=COMP (Com-plete)

- Keyword Subparameters for AM=SMARTS (Com-plete)

- Keyword Subparameters for AM=IMS

- Keyword Subparameters for DEFINE PRINTER Statement

## PRINT Parameter Syntax

With the `PRINT` parameter, you first specify one or more logical print file numbers, and then several keyword subparameters, which define the characteristics for these print files:

PRINT=((print-file-numbers),keyword-subparameter=value,...)

Where:

Syntax Element | Description
--- | ---
`print-file-numbers` | The file numbers must be specified first and enclosed in parentheses: The numbers can be from 0 to 31. They can be specified in any sequence. Multiple numbers must be separated from one another by commas or blanks. To specify a range of numbers, you can use a hyphen (-).
`keyword-subparameters` | The keyword subparameters (for the different environments) are described below. If any previous definition (or default) for the same print file exists, only the values for the specified keyword subparameters are overwritten, all other values remain unchanged.

Note
To provide different print file definitions, `PRINT` can be specified multiple times.

#### Examples:

    PRINT=((2,12,18),AM=STD,DEST='PRINT**',OPEN=INITOBJ,CLOSE=CMD)
    PRINT=((1,3,6-11,15),AM=NAF)
    PRINT=((0),AM=STD,DEST=HARDCOPX)

## NTPRINT Macro Syntax

With an `NTPRINT` macro, you first specify one or more logical print file numbers, and then several keyword subparameters which define the characteristics that are to apply to these print files:

              NTPRINT (print-file-numbers),keyword-subparameter=value,...

Where:

Syntax Element | Description
--- | ---
`print-file-numbers` | The file numbers must be specified first and enclosed in parentheses: The numbers can be from 0 to 31. They can be specified in any sequence. Multiple numbers must be separated from one another by commas or blanks. To specify a range of numbers, you can use a hyphen (-).
`keyword-subparameters` | The keyword subparameters (for the different environments) are described below. If any previous definition (or default) for the same print file exists, only the values for the specified keyword subparameters are overwritten, all other values remain unchanged.

Note
To provide different print file definitions, `NTPRINT` can be specified multiple times.

#### Examples:

             NTPRINT (2,12,18),AM=STD,DEST='PRINT**',OPEN=INITOBJ,CLOSE=CMD
             NTPRINT (1,3,6-11,15),AM=NAF
             NTPRINT (0),AM=STD,DEST=HARDCOPX

## Keyword Subparameters for All Environments

The following keyword subparameters are available for all environments:

`AM` | `CCHAR` | `DEST` | `OPEN` | `CLOSE` | `ROUTE` | `CP` | `SHIFT`

### AM - Type of Access Method

`AM=value` specifies the type of access method to be used.

Value | Access Method
--- | ---
`STD` | Standard sequential batch files (batch, TSO).
`COMP` | Com-plete print files.
`CICS` | CICS transient data or temporary storage.
`NAF` | Natural Advanced Facilities.
`IMS` | IMS TM destinations.
`PC` | Entire Connection.
`USER` | Third-party vendor print interface.
`SMARTS` | SMARTS print file.
`ESS` | Entire System Server.
`NOM` | Entire Output Management. Note Prints to an Entire Output Management container file without using the spool of the operating system. Refer to the Entire Output Management documentation for details.
`OFF` | Unassigned. No automatic assignments if `FAMSTD=OFF` is set. Note `PRINT=OFF` is equivalent to: `PRINT=((1-31)), AM=OFF)`. It does not affect any of the other keyword subparameter specifications.
`0` | Unassigned. Automatic assignments if `FAMSTD=OFF` is set. This is the default value.

Notes:

1. For an online session, all print files to be used have to be assigned to a specific access method.
2. For a batch session, any print files not assigned to a specific access method will be automatically detected and assigned by the standard batch access method (`AM=STD`), provided that they have been predefined in the JCL. See also FAMSTD - Overwriting of Print and Work File Access Method Assignments .
3. `PRINT=((0),AM=xxx)` or `NTPRINT (0),AM=xxx` determines the hardcopy print access method and is equivalent to the profile parameter `HCAM``=xxx`.

### CCHAR - Allow Output Control Characters

`CCHAR=value` allows you to define hexadecimal control characters for print file I/O to be passed through unchanged.

Value | Explanation
--- | ---
`a1` or `(a1,a2,…)` | A single hex character or a list of hex characters enclosed in brackets can be specified. The hex characters must be within `x'01'` through `x'3F'`. A hex character range `a1-a2` is allowed instead of a hex character. There is no default value.
`OFF` | `CCHAR=OFF` resets any previous `CCHAR` definitions.

Notes:

1. To avoid screen I/O errors, Natural automatically translates the output control characters `x'01'` through `x'3F'` to `'?'`. In some cases, however, certain control characters are required for special purposes. These can be specified with `CCHAR`.
2. For the specified print files, the `CCHAR` specification replaces the definitions in the output translation tables `NTTAB`, `NTTAB1` and `NTTABL` as contained in the configuration module `NATCONFG` or defined by the corresponding dynamic profile parameter or by the corresponding macro in the Natural parameter module.

#### Examples:

    CCHAR=17

    CCHAR=19-1B

    CCHAR=(03-06,0A,1B,3A-3F)

### DEST - External Data Set Name

`DEST=value` specifies the print destination (1 - 8 characters).

Access Method | Meaning of Keyword Subparameter DEST
--- | ---
`AM=STD` | `DEST` is the logical data set name (`DDNAME`, `LINK` name, `DTF` name). If the destination is to be for multiple files, two asterisks (**) have to be specified for the file number. These will be replaced by the corresponding logical file number for each print file. A `DEST` value including two asterisks must be enclosed in apostrophes when it is used as a dynamic parameter. The default value is `DEST='CMPRT**'`.
`AM=CICS` | There is no default value for print files under CICS. Here, the `DEST` subparameter is mandatory, that is, CICS print files defined without a valid `DEST` specification are ignored. The Natural CICS interface also supports a variable (see the `TERMVAR=&TID` default parameter setting in the `NTCICSP` generation macro) as part of the `DEST` value which, when being specified, is replaced by the actual CICS terminal ID. See also Natural Print and Work Files under CICS in the TP Monitor Interfaces documentation.
`AM=IMS` | Specifies the IMS TM destination.
`AM=PC` | When `DEST=DUMMY` all data downloaded to this print file is completely suppressed. A file selection prompt does not show. Other values assigned to `DEST` have no effect.

Notes:

1. `DEST=value` corresponds to the `OUTPUT` value of the `DEFINE PRINTER` statement (and can be overwritten by a `DEFINE PRINTER OUTPUT` specification).
2. The meaning of this keyword subparameter depends on the access method.
3. `PRINT=((0),DEST=xxx)` or `NTPRINT (0),DEST=xxx` determines the hardcopy print destination and is equivalent to the Natural profile parameter `HCDEST``=xxx`.

### OPEN - Time of File Opening

`OPEN=value` specifies when the file is to be opened.

Value | Explanation: The file is opened ...
--- | ---
`INIT` | for output at session initialization.
`OBF` | according to the default `OPEN` value for the different environments (batch, CICS, Com-plete, TSO).
`OBJ` | when the execution of the first object which accesses the file starts. This is the general default, except for `AM=COMP` and `AM=IMS`.
`OBJ1` | when the execution of the first object on Level 1 that accesses the file starts. Otherwise, it is opened when it is first accessed.
`ACC` | when it is first accessed by a statement. This is the default for `AM=COMP` and `AM=IMS`.
`INITOBF` | for output at session initialization. Any subsequent re-opening of the file sets the default `OPEN` value for the different environments (batch, CICS, Com-plete, TSO).
`INITOBJ` | for output at session initialization. Any subsequent re-opening of the file will be performed when the execution of the first object which accesses the file starts.
`INITOBJ1` | when the execution of the first object on Level 1 that accesses the file starts. Otherwise, it is opened when it is first accessed.
`INITACC` | for output at session initialization. Any subsequent re-opening of the file will be performed when it is first accessed by a statement.

### CLOSE - Time of File Closure

`CLOSE=value` specifies when the file is to be closed.

Value | Explanation: The file is closed ...
--- | ---
`OBJ` | either when processing of the object in which it was first accessed is finished or when command mode, `NEXT` mode or `MAINMENU` is reached.
`CMD` | when command mode, `NEXT` mode or `MAINMENU` is reached. This is the default for `AM=NAF`, `AM=COMP` and `AM=IMS`.
`FIN` | at session end (this is the default for `AM=STD`). Note With `CLOSE=FIN`, a `DEFINE PRINTER` statement causes an error if the printer was opened already. A `CLOSE PRINTER` statement for the printer is ignored.
`USER` | only if the file is open and one of the following conditions is true: a `CLOSE PRINTER` statement is issued, a `DEFINE PRINTER` statement is issued, at session termination.

### ROUTE - Logical Print File Routing

`ROUTE=value` specifies whether logical print file routing is done according to the `OUTPUT` clause of the `DEFINE PRINTER` statement.

Value | Explanation
--- | ---
`ON` | Print file routing is done. The target print file can be any available print file except `PC`. This is the default value.
`OFF` | No print file routing is done.
`am` | Print file routing is done to printers of the specified access method only. Possible value is any valid print file access method (see subparameter `AM` described above). `PC` is not allowed for `am`.

Note
Print file routing means that, if the name defined in the `OUTPUT` clause of a `DEFINE PRINTER` statement denotes a print file destination which is defined by a different logical printer, all print output is routed to this print file. If no printer with the specified name is found, the print output can be routed to any free printer.

### CP - Code Page for Print Output

`CP=value` specifies the code page for the print output.

Value | Explanation
--- | ---
1 - 64 characters. | The name of the desired code page. Any character string is possible, but must be predefined by one of the code page parameters `CCSID`, `CCSN`, `IANA` or `ALIAS` of the macro `NTCPAGE` in the source module `NATCONFG`.

Notes:

1. It is assumed that all code page data, for example, Natural sources, contents of A-format fields, etc., are stored in this code page. If no code page is specified with the keyword subparameter `CP`, the code page resulting from the evaluation of the profile parameter `CP` is used.
2. If Natural code page support is disabled (for example, by profile parameter `CP=OFF`), any value specified for this parameter is ignored.
3. See also profile parameter `CP` and Profile Parameters and Macros in the Unicode and Code Page Support documentation.

### SHIFT – Shift Data Record to the Right

`SHIFT=value` specifies whether the print records are shifted to the right by the number of blanks `nnn`.

Value | Explanation
--- | ---
`0` or `1 - 248` | The print records are shifted to the right and the specified number of blanks is inserted in front of the record starting with column 1.
`0` | The print records are not shifted. This is the default value.

Notes:

1. The ASA control character in column 0 is not affected.
2. The specified number of characters at the end of the records is lost due to shift out.

## Keyword Subparameters for AM=STD in All Environments

The following keyword subparameters are available for access method `AM=STD` in all environments:

`RECFM` | `BLKSIZE` | `LRECL` | `TRUNC` | `PAD` | `PADCHRO` | `ASA` | `STRIP`

### RECFM - Default Record Format of Data Set

`RECFM=value` specifies the default record format of the data set.

#### Supported Formats

Value | Format
--- | ---
`F` | Fixed
`V` | Variable
`U` | Undefined
`B` | Blocked
`S` | Spanned
`A` | ASA
`M` | Machine control characters

#### Possible Values or Combinations of Values

Value | Explanation
--- | ---
`RECFM=F, RECFM=FA, RECFM=FM, RECFM=FB, RECFM=FBA, RECFM=FBM, RECFM=V, RECFM=VA, RECFM=VM, RECFM=VB, RECFM=VBA, RECFM=VBM, RECFM=VBS, RECFM=VBSA, RECFM=VBSM, RECFM=U, RECFM=UA, RECFM=UM` | These values or combinations of values can be specified.
`RECFM=VBA` | Variable blocked with ASA. This is the default value.

Note
The `RECFM` specification only applies if no record format is predefined in the JCL or (z/OS only) in the data set DCB.

### BLKSIZE - Default Block Size of Data Set

`BLKSIZE=value` specifies the default block size of the data set.

Value | Explanation
--- | ---
`0` or `8` - `32767` | Default block size of the data set (in bytes).
`1016` | This is the default value.

Note
The `BLKSIZE` specification only applies if no block size is predefined in the JCL or (z/OS only) in the data set DCB.

### LRECL - Default Record Length of Data Set

`LRECL=value` specifies the default record length of the data set.

Value | Explanation
--- | ---
`0` or `5 - 254` | Record length of the data set (in bytes).
`0` | This is the default value.

Notes:

1. This subparameter can be used to check for truncation and padding.
2. For `RECFM=V(B)` the `LRECL` value includes a 4-byte record descriptor word.
3. If `LRECL=0` is defined, the following applies:
   With `RECFM=V(B)`, `LRECL` defaults to the minimum of `BLKSIZE-4` and `254`.
   With `RECFM=U`, `LRECL` defaults to `BLKSIZE`.
   With `RECFM=F(B)`, the maximum record length in the Natural program being executed is taken when the file is opened. If no record length from a program is available when the file is opened, for example with `OPEN=INIT`, a record length of 132 is taken (plus 1 for ASA or a machine control character and/or plus 4 for a record-descriptor word if the record format is variable).
4. The `LRECL` specification only applies if no record length is predefined in the JCL or (z/OS only) in the data set DCB.

### TRUNC - Truncation of Output Records

`TRUNC=value` specifies whether the output records are truncated.

Value | Explanation
--- | ---
`ON` | Output records that are longer than the record length (`LRECL`) of the data set will be truncated. This is the default value.
`OFF` | Error NAT1512 will be issued if an output record is longer than the data set record length.

### PAD - Padding of Output Records

`PAD=value` specifies whether the output records are padded or not (applies only to data sets of fixed record length).

Value | Explanation
--- | ---
`ON` | Output records that are shorter than the record length (`LRECL`) of the data set will be padded with padding characters defined by keyword subparameter `PADCHRO`. This is the default value.
`OFF` | Error NAT1510 will be issued if an output record is shorter than the data set record length.

### PADCHRO - Padding Character of Output Records

`PADCHRO=value` specifies the character which is used for padding if `PAD=ON` is defined for the print file.

Value | Explanation
--- | ---
`'x'` | One character `x` within single quotes
`x'xx'` | One hex character `xx`
`' '` (blank) | Blank or `x'40'` This is the default value.

### ASA - Use of ASA Record Format

`ASA=value` specifies whether the ASA record format is used.

Value | Explanation
--- | ---
`ON` | An ASA character is included in the output print records. Under z/OS, this enforces ASA record format, regardless of the `RECFM` setting in the `DCB` or the `RECFM` subparameter. This is the default value.
`OFF` | No ASA character is included in the output print records.

### STRIP - Inhibit Removal of Trailing Blanks

`STRIP=value` can be used to inhibit the removal of trailing blanks.

Value | Explanation
--- | ---
`ON` | Trailing blanks are stripped off. This is the default value.
`OFF` | Trailing blanks are not stripped off.

Note
Trailing blanks are stripped off for batch sequential print files (access method `AM=STD`) if the data set is defined with variable record format (`RECFM``=VB`) to reduce disk space. This may cause problems with subsequent applications accessing this data set, due to the missing blanks. These problems can be avoided by setting `STRIP=OFF`.

## Keyword Subparameters for AM=STD in z/OS Environments

The following keyword subparameters are available for access method `AM=STD` in z/OS environments:

`REREAD` | `FREE` | `BUFNO` | `DISP` | `VMAX`

### REREAD - Closing of Tape File Data Sets

`REREAD=value` specifies the `REREAD` option for the closing of the tape file.

Value | Explanation
--- | ---
`ON` | The `REREAD` option is set for the `CLOSE SVC`. This causes the volume to be repositioned to reprocess the data set . This is the default value.
`OFF` | The `REREAD` option is not set for the `CLOSE SVC`.

### FREE - Data Set De-allocation at File Closure

`FREE=value` specifies whether the data set is de-allocated when the file is closed.

Value | Explanation
--- | ---
`ON` | The `FREE` option is set for the `CLOSE SVC`, which means that the data set is de-allocated when it is closed (and not at step termination).
`OFF` | The `FREE` option is not set for the `CLOSE SVC`. This is the default value.

### BUFNO - Default Number of z/OS I/O Buffers of Data Set

`BUFNO=value` specifies the default number of z/OS I/O buffers of the data set.

Value | Explanation
--- | ---
`0` or `1 - 255` | Default number of z/OS I/O buffers of the data set.
`0` | In this case, z/OS allocates five I/O buffers. This is the default value.

Notes:

1. The number of I/O buffers can improve the performance of print file access dramatically. Note that the storage for I/O buffers is allocated below the 16 MB line.
2. The `BUFNO` specification applies only if the `BUFNO` parameter is not specified in the JCL for the data set.

### DISP - Open Print File for Modification

`DISP=value` specifies whether the print file is opened for modification.

Value | Explanation
--- | ---
`MOD` | New records are added at the end of the file.
`NOMOD` | The print file is rewritten from the start. This is the default value.

Note
This subparameter corresponds to the JCL DD statement parameter `DISP=MOD`.

### VMAX - Control LRECL for Variable Record Format

`VMAX=value` controls the `LRECL` setting for an output file with variable record format (`RECFM=V`).

Value | Explanation
--- | ---
`ON` | Providing a non-zero `BLKSIZE` value exists for the file, `VMAX=ON` sets `LRECL=BLKSIZE-4` for variable record format, regardless of the `LRECL` setting in the `DCB` or the `LRECL` subparameter.
`NAT` | `LRECL` is set to the length +4 of the largest record in the application program if this value is less than `LRECL` in the `DCB` for the data set.
`OFF` | `LRECL` from the `DCB` for the data set or the `LRECL` subparameter is used. This is the default value.

## Keyword Subparameters for AM=CICS

The following keyword subparameters are available for access method `AM=CICS`:

`TYPE` | `DISP`

### TYPE - Type of CICS Storage Medium

`TYPE=value` specifies the type of CICS storage medium to be used.

Value | Explanation
--- | ---
`MAIN` | Temporary main storage.
`AUX` | Temporary auxiliary storage.
`TD` | Transient data.

Note
The default value used depends on the setting of subparameter `DEST`. If the `DEST` subparameter value matches a valid CICS transient data queue, the `TYPE` subparameter defaults to `TD`, otherwise `MAIN` will be taken as the default value.

### DISP - CICS Temporary Storage Queue Disposition

`DISP=(value1,value2)` specifies the CICS temporary storage queue disposition.

Value Pair | Explanation
--- | ---
`(NEW,KEEP)` | The storage queue is deleted when the file is opened. This is the default value.
`(NEW,DELETE)` | The storage queue is deleted when the file is opened and when it is closed.
`(OLD,DELETE)` | The storage queue is deleted when the file is closed.
`(OLD,KEEP)` | The storage queue is not deleted.

#### Example:

    DISP=(NEW,DELETE)

Note
The `DISP` specification does not apply to CICS extra-partition transient data queues.

## Keyword Subparameters for AM=COMP (Com-plete)

The following keyword subparameter is available for access method `AM=COMP` (Com-plete):

`DRIVER`

### DRIVER - Name of Com-plete Print Driver

`DRIVER=value` specifies the name of the Com-plete print driver to be used.

## Keyword Subparameters for AM=SMARTS (Com-plete)

The following keyword subparameter is available for access method `AM=SMARTS` (Com-plete):

`DEST`

### DEST - Logical Printer

`DEST=value` specifies the logical printer.

Value | Explanation
--- | ---
`print-server-queue` | The environment variable `SAG_APS_LPD_xyz` defines a logical printer under Com-plete, where `xyz` is the name of the print server queue. If the environment variable `SAG_APS_LPD_xyz` exists for the specified `DEST`, the output is directly routed to that line printer. For more information, see the Complete Initialization and Startup Manual, section Defining Terminals and Printers.
`printer-file-name` | If no print server queue for that printer is available, `DEST` specifies a printer file name. It specifies the location of the output file in the file system. The name of the output file is generated from the `UserId` and a sequence number. Since the `DEST` clause is restricted to an 8 character maximum, it is useless to define a file with absolute PFS path specification. The name specified in the `DEST` clause is relative to the print file root directory. The print file root directory is specified with the environment variable `NAT_PRINT_ROOT`.

#### Example:

    NAT_PRINT_ROOT=/nat/printer
    DEST=printer1
    UserId=xyz

The first output will be written to file `/nat/printer/printer1/xyz1`.

To specify a file with absolute path definition, the `OUTPUT` clause of the `DEFINE PRINTER` statement must be used.

## Keyword Subparameters for AM=IMS

The following keyword subparameters are available for `AM=IMS`:

`BLKSIZE` | `DRIVER`

For possible values and further information, see Support of the Natural WRITE (n) Statement in the Natural under IMS TM part of the TP Monitor Interfaces documentation.

### BLKSIZE - Size of the Print Buffer

`BLKSIZE=value` specifies the size of the print buffer sent to the IMS TM destination.

### DRIVER - Name of Natural IMS Print Driver

`DRIVER=value` specifies the name of the Natural IMS print driver to be used.

## Keyword Subparameters for DEFINE PRINTER Statement

With the following keyword subparameters, you can set the default values for the `DEFINE PRINTER` statement options of the same names. When a printer is closed, all `DEFINE PRINTER` statement options are reset to their default values.

`PROFILE` | `NAME` | `FORMS` | `DISP` | `COPIES` | `CLASS` | `PRTY`

### PROFILE - Name of Printer Control Characters Table

`PROFILE=value` specifies the name of the printer control characters table (`NTCCTAB` macro).

### NAME - Name of Listing

`NAME=value` specifies the listing name.

### FORMS - Name of Listing Forms

`FORMS=value` specifies the listing forms name.

### DISP - Listing Disposition

`DISP=value` specifies the listing disposition (`HOLD`, `KEEP`, `DELETE` or `LEAVE`).

### COPIES - Number of Copies

`COPIES=value` specifies the number of copies to be printed (`1 - 255`).

### CLASS - Spool Class

`CLASS=value` specifies the spool class (1 byte).

### PRTY - Listing Priority

`PRTY=value` specifies the listing priority (`1 - 255`).

### On this page

- PRINT Parameter Syntax
- NTPRINT Macro Syntax
- Keyword Subparameters for All Environments
- Keyword Subparameters for AM=STD in All Environments
- Keyword Subparameters for AM=STD in z/OS Environments
- Keyword Subparameters for AM=CICS
- Keyword Subparameters for AM=COMP (Com-plete)
- Keyword Subparameters for AM=SMARTS (Com-plete)
- Keyword Subparameters for AM=IMS
- Keyword Subparameters for DEFINE PRINTER Statement