This document describes the print file/work file server
                      NATPWSV2 for the RPC batch server environment under BS2000 that is
                      started via the RPC Server
                         Front-End.
               
This section covers the following topics:
See also Print File/Work File Server NATPWSV2 Error Messages in the Messages and Codes documentation.
The print file/work file server NATPWSV2 communicates with
                       the RPC batch server NATFSTB2 by using the forward eventing
                       method.
               
To setup the print file/work file server, perform the following steps:
Link the module NATFSTB2 to the Natural nucleus. The
                               module NATFSTB2 replaces the program
                               NATWKFB2.
                     
The module NATPWSV2 must be linked, together with an
                               ADDON parameter definition, for the common memory pool
                               with the new pool type PWK (print file/work file control pool) in
                               the program BS2STUB. This common memory pool must be set up using
                               a defined fixed address, for example:
                     
PWKSTUB  BS2STUB PARMOD=31,PROGMOD=ANY,UNRES=*DBLOPT
         ADDON NAME=PWK#POOL,       NAME OF CONTROL POOL          -
               TYPE=PWK,            TYPE OF CONTROL POOL          -
               SIZE=1MB,            POOL SIZE IN MB               -
               STAT=LOCAL,          POOL STATUS IS LOCAL          -
               SCOP=GLOBAL,         SCOPE IS GLOBAL               -
               POSI=ABOVE,          POOL POSITION IS ABOVE        -
               ADDR=19,             ADDRESS IS X'1300000'         -
               PFIX=YES,            POOL ADDRESS IS FIXED         -
               ACCS=WRITE           NO POOL PROTECTION
          ADDEND 
                   The same ADDON parameter definition (except for
                       ADDR=) must be contained in the program BS2STUB which
                       is linked to the front-end part of the RPC batch server.
               
Example of linking the print file/work file server:
/START-PROGRAM $BINDER                                                
START-LLM-CREATION INTERNAL-NAME=PWKSRV,                             -
SLICE-DEFINITION=*BY-ATTRIBUTES(RESIDENCY-MODE=*YES)                  
INCLUDE-MODULES NATPWSV,LIB=(NATvrs.MOD)                              
INCLUDE-MODULES PWKSTUB,LIB=(user-lib)                                 
MODIFY-SYMBOL-ATTRIBUTES ADD-MODE=*31,RES-MODE=*ANY,READ-ONLY=*NO     
MODIFY-SYMBOL-VISIBILITY                                             -
          SYMBOL-NAME = *ALL,                                        -
          SYMBOL-TYPE = *DEFINITIONS,                                -
          VISIBLE = *NO(KEEP-RESOLUTION=*YES)                         
SAVE-LLM LIB=NATURAL.USER.MOD,ELEMENT=E.NATPWSV2,LOAD-ADDR=X'10000000'
END 
                   where:
vrs | 
                        is the relevant product version of Natural for Mainframes and | 
user-lib | 
                        is the user library. | 
Data exchange between the print file/work file server and the RPC batch
                       server takes place in the print file/work file control pool
                       (TYPE=PWK).
               
The print file/work file server has to be started before the RPC batch server.
The RPC batch server expects the presence of an initialized print file/work file control pool. This initialization occurs when the print file/work file server is started.
A Natural RPC batch server communicates with exactly one print file/work file server and vice versa (TSN1 <=> TSN2).
All print files and work files (link names P01 to P32
                        and W01 to W32) to be used have to be defined by a
                        FILE command in the print file/work file server's
                        job control.
               
Example of a start job:
/.PWKSRV LOGON /ER LST.PWKSERVER. /STEP /OPTION DUMP=YES /FILE WORK.W01,LINK=W01 /FILE WORK.W02,LINK=W02 . . /FILE PRINT.P01,LINK=P01 /FILE PRINT.P02,LINK=P02 . . /EXEC (NATPWSV2,NATURAL.NATvrs.MOD) /LOGOFF N
where vrs represents the relevant product version.
The print file/work file server can be terminated by way of
                        P1 eventing, using the program CMPEND. The event name
                        for terminating the print file/work file server is the name of the print
                        file/work file control pool.
               
Example of a print file/work file server termination procedure:
/BEGIN-PROCEDURE LOGGING COMMANDS /ASSIGN-SYSDTA TO=*SYSCMD /SET-JOB-STEP /START-PROGRAM FROM-FILE=*MODULE(LIBRARY=NATURAL.NATvrs.MOD,- / ELEMENT=CMPEND) PWK#POOL <== name of the print file/work file control pool /SET-JOB-STEP /ASSIGN-SYSDTA TO=*PRIMARY /EXIT-PROCEDURE
where vrs represents the relevant product version.
All error messages (abnormal termination of the print file/work file
                        server) are written to SYSLST99 into the file
                        LST.PWKSERVER.tsnn.