System Spool Access

This document describes the Write-to-Spool feature for Natural.

This feature is available under z/OS and z/VSE only.

The following topics are covered:

See also:


Purpose

The Write-to-Spool feature enables Natural users to write reports to the system spool directly. It can be used in any Natural environment (Com-plete, TSO, CICS, IMS TM, batch, etc.) and uses the Entire System Server view WRITE-SPOOL.

Under z/OS, the SYSOUT is part of the Entire System Server job stream within the JES spool, and it may be processed by any software which expects output in JES Spool, for example, Entire Output Management. The JES spool may be a JES2 or a JES3 spool.

Under z/VSE, the SYSOUT is a separate entry in POWER queue.

Prerequisite

To use the Write-to-Spool feature, the Entire System Server needs to be installed.

Using the Write-to-Spool Feature

The Write-to-Spool feature is handled by a so called "access method", which is called ESS for Entire System Server. You may define your printer in the Natural parameter module or dynamically in your session parameters.

Defining Your Printer

Beginn der AnweisungslisteTo define your printer

  1. Define the printer in the Natural parameter module.

    Use the NTPRINT macro to specify the printer number (n) and the access method (AM):

    NTPRINT (n),AM=ESS

    Example:

    NTPRINT (1,3),AM=ESS

    In this example, the printers 1 and 3 are defined for use with access method ESS (Entire System Server).

    Or:

    Define the printer during session startup by specifying the profile parameter PRINT, for example:

    PRINT=((1-6),AM=ESS)

    In this example, the printers 1 to 6 are defined for use with access method ESS (Entire System Server).

  2. Link the access-method modules to the Natural nucleus.

    See the platform-specific Installation documentation.

    Or:

    Load it dynamically by specifying the following profile parameters RCA and RCALIAS:

    RCA=(NATAM11),RCALIAS=(NATAM11,NATPWSAM)

    where NATPWSAM is the delivered write-to-spool module containing the default parameters.

    If you have linked a module with adapted parameters, use the name of this module instead.

  3. Define the JES destination with the OUTPUT option of the DEFINE PRINTER statement. You can use one of the following examples depending on whether you want to send the output to a spool file, a local JES printer, or through a remote JES node to a remote user or device.

    Example:

    DEFINE PRINTER (n) OUTPUT 'LOCAL' /* For printing on local JES/POWER printers

    Or:

    DEFINE PRINTER (n) OUTPUT 'DAEF' /* For printing to JES spool called DAEF

    Or:

    DEFINE PRINTER (n) OUTPUT 'DEST=node-name,REMOTE-USERID=user-id'  /* For printing to remote JES nodes

    where:

    • n is the number in the NTPRINT entry in the Natural parameter module described in Step 1.

    • node-name is the name of the remote JES node.

    • user-id the ID of the user or device who receives the output.

    Reports can now be written to the system spool using one of the following statements:

    DISPLAY (n)

    or

    PRINT (n)

    where n is the number in the NTPRINT entry in the Natural parameter module in Step 1.

    Users can set the output format and number of copies using the FORMS and COPIES clauses of the DEFINE PRINTER statement.

    Example:

    DEFINE PRINTER (2) OUTPUT 'DEST'
                       FORMS 'FORM'

    The defaults for items such as Entire System Server node, forms and output class can be found in the module NATWSPDF.

Examples for z/OS

Example 1

Assume using the factory settings and executing the Natural program:

DEFINE PRINTER (2) OUTPUT 'WK1'
WRITE (2) 'THIS IS A SMART RECORD' 
CLOSE PRINTER (2)

During the execution of this program, you can see the following fields with their values in the Display Active Tasks panel:

DDNAME     DSID Owner C Dest Rec-Cnt Forms Wtr PageDef FormDef
SYS00001   104  WKK   A WK1     2     STD

Browsing this data set, you can see:

Page 1 
THIS IS A SMART RECORD
Example 2

Assume using the default member:

Parameter Explanation (Possible Values)
WSPDFLT NODE=55526, Entire System Server target node number (5 characters at maximum)
PROGRAM=HUGO, JES writer (8 characters at maximum)
CLASS=Y, SYSOUT class (1 character)
HOLD=YES, Hold (YES or NO)
CNTL=A, Carriage control (A or M)
FORM=WOFO, Form (4 characters at maximum)
RMT=JESWOLF, JES remote (8 characters at maximum)
FORMDEF=FOWOLF, Form definition (6 characters at maximum)
PAGEDEF=PAWOLF Page definition (6 characters at maximum)

Execute the following Natural program:

DEFINE PRINTER (2) OUTPUT 'WK1'
WRITE (2) 'THIS IS A SMART RECORD' 
CLOSE PRINTER (2)

During the execution of this program, you can see the following fields with their values in the Display Active Tasks panel:

DDNAME   DSID Owner C Dest Rec-Cnt Forms  Wtr   PageDef  FormDef
SYS00002 105   WKK  Y  WK1    2     WOFO  HUGO  PAWOLF   FOWOL

Browsing this data set, you can see:

Page 1 
THIS IS A SMART RECORD
Example 3

Assume using the default member:

Parameter Explanation (Possible Values)
WSPDFLT NODE=55526, Entire System Server (NPR) target node (node number)
PROGRAM=*OUTPUT, JES writer (8 characters at maximum)

The other parameters in the default member are not changed.

Run the following example program:

DEFINE PRINTER (2) OUTPUT 'KURT' 
PRINT (2) ' here comes KURT'       
CLOSE PRINTER (2)

After that, Entire System Server fetches the value from the field OUTPUT in the DEFINE PRINTER statement and inherits it as the JES writer attribute for the specific spool data set.

Looking in TSO/SDSF under the job name of Entire System Server, you can see the following:

PREFIX=NPR*  DEST=(ALL)  OWNER=*  SYSNAME=              
NP   DDNAME   Time     Forms    FCB  UCS  Wtr      Flash
     SYS00005 10:20:48          **** **** KURT     ****

If in JES an associated JES writer program is defined, it gets control and handles this output as defined in the program.

Examples for z/VSE

In z/VSE, the output is written into the POWER spool under a new job number. The name of the printed spool data set will be the name of the original batch job or the user ID of the TP monitor.

Example 1

Assume we are using the factory settings for NATWSPDF and have the natural program:

DEFINE PRINTER (2) OUTPUT 'ELSA'
WRITE (2) 'THIS IS A SMART RECORD'
CLOSE PRINTER (2)

User WKK is running this program in a batch-mode Natural, with JOBNAME=GERHARD.

The power queue contains the following information:

JOBNAME JOBNO   Q NUM C D PR  STAT FROM TO   CP PAGES RECORDS ID 
GERHARD 0020443 L     A H 003 HOLD WKK  ELSA  1     1       2

Browsing this output displays the following information:

BROWSE-DJ:GERHARD(20443)-Queue:LS --------------------- Row 0 - Columns 001 076
  COMMAND===>                                                    SCROLL===> CSR 
****************************** top of list *******************************
1Page      1                                                date, time
0THIS IS A SMART RECORD                                                   
**************************** bottom of list ******************************
Example 2

Assume we are using the factory settings for NATWSPDF and have the natural program:

DEFINE PRINTER (2) OUTPUT   'KARL' 
                   FORMS    'F001'                        
                   COPIES   4                              
WRITE (2) 'PRINTER TEST' 
WRITE (2) 'OK?' 
CLOSE PRINTER (2)

The power queue contains the following information:

JOBNAME  JOBNO   Q NUM C D PR  STAT FROM  TO   FORM CP  PAGES RECORDS ID PR 
GERHARD  0020465 L     A H 003 HOLD WKK   KARL F001   4     1       3