Work with Remote Writers

The STRRMTWTR (Start Remote Writer) command will be used to initiate remote system printing. Any spool output file from a local (or remote) system can be sent to a specified remote system with STRRMTWTR.

 After the spooled output file is successfully sent to a remote system, it is then deleted or saved as determined by the SAVE spool file attributes option on the local system.

Benefits of using remote system printing:

  • Spooled output files can be placed automatically on a specific output queue and we know it will automatically be moved to the target system
  • Output queues can have multiple remote writers started to them.
  • Once the remote writers have been setup, the STRRMTWTR (Start Remote Writer) command initiates all activity necessary to send spool files to the remote system. An auto-start job entry may exist in the subsystem QSPL when the subsystem is started. This job runs the STRRMTWTR command with OUTQ parameter set to *ALL. This enables all remote writers to be started to all output queues that have a remote system specified.
  • The spool file attributes are available including the user who created the file, the original system where the file was created; and user print information such as user defined text.
  • Setting up the output queue on the source (local) system

    The CRTOUTQ (Create Output Queue) command has parameters that allows the STRRMTWTR command to send spooled output files to a remote system.

    The following parameters will be used to control the remote printing:

    OUTQ
    Qualified name of the output queue on the local system.

    RMTSYS
    The remote system to send the spool files. The entry here must be validated against our XLIB/XFPAPEER file.

    RMTPRTQ
    The qualified printer queue on the remote system to which the spool files will be printed. This parameter accepts *USER or *SYSTEM as parameters.

    If *USER is used, the file is spooled to the OUTQ of the original owner in the target system. If the original owner does not exist on the target system, the file is spooled to the default OUTQ for user QNETSPLF.

    If *SYSTEM is used for the parameter, the files will be spooled to the OUTQ designated by the system value QPRTDEV. The spool file will be own by the original owner of the spool file. If the original owner does not exist in the target system, QNETSPLF will be the default owner.

    AUTOSTRWTR
    This parameter is the number of remote writers that are started automatically by the source system. 1 will be used for this parameter. This way, the STRRMTWTR *ALL can be executed when the output queue is created.

    CNNTYPE
    This parameter is the type of connection with the remote system. This parameter determines the protocol used by the remote writer when sending spooled files. The default parameter *SNA will be used as the spool files are sent using SNADS.

    DESTTYPE
    This parameter determines the type of remote system. The default *OS400 will be used for this parameter.

    The parameters mentioned above will exist in the new file that will replace the old XFPTFROQ (Spool file attributes) file. The CRTOUTQ command for remote printing shall only be executed through the WRKRMTWTR command. If any of the parameters for the remote output queue needs to be changed, all modification must be done through this command. The new output queue will be owned by the group profile QPGMR.

    The STRRMTWTR command will be executed immediately following CRTOUTQ command (for new remote output queues). An option will also be available on the screen to start the output queues for remote printing.

    Remote Output Queue File (TSRMOQ)

    TSSOQN 10 A Source Output Queue Name
    TSSOQL 10 A Source Output Queue Library
    TSSOQT 50 A Source Output Queue Description
    TSTGTM 10 A Target (Remote) Machine
    TSTOQN 10 A Target Output Queue Name
    TSTOQL 10 A Target Output Queue Library

    TSRMOQ will reside on all machines. The fields will contain the parameters that drive the creation of the remote output queue.

     

    Work with Remote Writers (WRKRMTWTR)

    This screen will be used to show the overall status of each of the remote output queues in the system, whether they are either started or ended. This display will use TCRMOQ to view all the remote output queues added.

    An option number can be entered next to one or more source output queues. When Enter is pressed, the function associated with the option is performed for each of the selected output queues (e.g. 1=Start, 2=Edit, 3=Hold, 4=End, 5=Work with OUTQ, 6=Release, 13=Delete).

    1=Start
    To Start the Remote Writer (STRRMTWTR), enter this option next to the source output queue to start.

    Starting an output queue that is already started will not cause an abnormal termination. Instead, a warning message will be sent to inform the user that the writer has already been started.

    If the start remote writer is successful, a completion message will be displayed at the bottom of the screen informing you that the "Reader or writer is submitted to job queue QSPL". Press F5 to update the status on the list.

    2=Edit
    Enter this option to change the description or target information for the source output queue. Another window screen will be display to allow the user to change the description & target information. The source output queue & library name cannot be changed.

    In order to change the target information for the source output queue, the source output queue writer status must be ended (status is *NA for Not Attached). If the status is STR (Started), when you press Enter from the window display, a warning message will be displayed to press F12 and end the writer first.

    3=Hold
    This option holds the active writer. The writer status must be started (STR) for this option to work.

    This option holds the writer. The writer status changes from STR status to HLD status. When the writer is on Hold status, non of the spool output files get transmitted to the remote output queue. This is very useful if you wish to change the spool file attributes of the spool files residing in the source output queue.

    4=End
    This option will end the writer immediately. The writer status changes from STR (Started) to *NA (Not Attached) once the command is successful. A completion message will also be displayed at the bottom of the screen that says "Writer in the process of ending".

    If you selected this option on a source output queue whose writer status is *NA, a warning message will be displayed at the bottom of the screen that says "Writer not active nor in the job queue".

    5=Work with
    This option executes the Work with Output Queue (WRKOUTQ) command for the source output queue. The WRKOUTQ screen enables the user to change the attributes of the spool files within the output queue.

    If the writer status for the source output queue is *NA, you may take option 5 to work with the source output queue. Within the WRKOUTQ screen, you can change the spool file attributes by taking option 2 right next to the spool files you wish to change.

    If the writer status for the source output queue is STR, you may take option 5 to work with the source output queue. All the spool files will be sent automatically to the remote output queue that you have assigned. The status for each spool file becomes SND (sending). In order to save the spool file in the source output queue, you must change the spool attributes to SAVE(*YES). Otherwise, once the spool file is sent to the remote system, the spool file is removed from the source output queue.

    6=Release
    This option releases the held writer. The writer status must be in Hold (HLD) status for this option to work. The writer status changes from HLD status to STR status.

    13=Delete
    This option deletes the source output queue entry from the TSRMOQ file. This also deletes the output queue device from the source machine, and it deletes the output queue device from the target machine.

    If the source output queue writer status is STR, the Delete Output Queue window will display a message informing you that "You cannot delete the output queue, press F12 and end the writer first". You can only delete the output queue if the writer status is *NA.

    17=Disconnect
    This option enables us to remove the connection between the local output queue and the remote output queue.

    If the source output queue writer status is STR, the Disconnect Output Queue window will display a message informing you that "Writer cannot be disconnected, press F12 and end the writer first". You can only disconnect the output queue if the writer status is *NA.

    Function Keys available in WRKRMTWTR:

    F3=Exit
    Press this function key to exit the program

    F5=Refresh
    This key will refresh (reload) the entire list of source output queues. The writer status will be checked again for each source output queue. This key is recommended after the user request to Start or End the writer since when these options are requested, the STRRMTWTR & ENDWTR command are OS/400 requests that are submitted to batch.

    This key will only be displayed when source output queue exist in the TSRMOQ file.

    F9=Add
    This key will bring up another window screen to add new source output queue.

    F11=Desciption
    Press this key to toggle the list to display between the source output queue description or the Target Output Queue information.

    This key will only be displayed when source output queue exist in the TSRMOQ file.

    Getting Started with WRKRMTWTR

    The WRKRMTWTR comprises 2 modules: TS0010R (RPGMOD) and TS0011C (CLMOD). It also uses the UT0010C (CLP) to handle the message subfile display on the screen. TS0010R must be created using the CRTRPGMOD (Create RPG Module) command with the parameter of DBGVIEW(*SOURCE). TS0011C must be created using the CRTCLMOD (Create CL Module) command with the same parameter DBGVIEW(*SOURCE).

    When both modules are created, create the program TS0010R using the command:

    CRTPGM PGM(TS0010R) MODULE(TS0010R TS0011C)

    You must also create the command WRKRMTWTR (Work with Remote Writers) using TS0010R for the CPP.

    Enter WRKRMTWTR on a command line to start maintenance. Your initial screen should not have any source output queue listed.

    Adding new source output queue

    1. Press F9 to add new remote output queue. A window screen will be displayed. Enter the new output queue name, library and text. You must enter a valid Target Machine Name. The Target Machine name will be validated against the XFPAPEER file. Enter the target output queue name and library you want the source output queue to be attached to. *LIBL will not be allowed in the library name. Enter QGPL or QUSRSYS if you are not sure what library to use. Make sure you are consistent with the library names.
    2. Press Enter on the Add Remote Output Queue. Another window will be displayed with "Please wait" message.

    When the Update Local & Remote OUTQ window is displayed, 2 processes happen:

    1. The source output queue list will be displayed again. The new source output queue will be displayed on the list with a writer status of STR (Started).

    Changing the Source Output Queue Description

    You may change the source output queue description regardless of the writer status (STR or *NA).

    1. Enter option 2 next to the source output queue.
    2. On the Work with Remote Output Queue Window change the source output queue text field. You may enter lowercase.

    Changing the Source Output Queue Target Information

    The writer status for the source output queue must be ended first (Wtr Sts = *NA for Not Attached).

    1. Go to step 2 if the writer status is *NA. Enter option 4 to end the writer immediately. A message appears informing you that the writer is in the process of ending. The writer status changes from STR to *NA.  
    2. Enter option 2 to change the source output queue.
    3. On the Work with Remote Output Queue Window you may change the target machine, OUTQ name or OUTQ library information.

    The Update Local & Remote OUTQ window appears. 3 processes happen:

    Ending / Detaching Source Output Queue

    The writer status for the source output queue must be STR (Started / Attached to a Remote OUTQ) to end the writer.

    1. Enter option 4 to end the writer immediately. A message appear at the bottom of the screen saying that the "Writer is in the process of ending". When the writer is ended, the writer status changes from STR to *NA.

    Deleting Source or/and Target Output Queue

    The writer status for the source output queue must be STR (Started / Attached to a Remote OUTQ) to delete the output queue.

    1. Go to step 2 if the writer status is *NA. Enter option 4 to end the writer immediately. A message appears informing you that the writer is in the process of ending. The writer status changes from STR to *NA.
    2. Enter option 13 to delete the output queue.
    3. On the Delete Output Queue Window, all the source & target output queue will be protected. You will be presented with a message – "Enter B=Both OUTQ, S=Source only, T=Target only. .". You must enter either B, S or T on the field provided. The following happens based on your entry:
    1. A confirmation message appears at the bottom of the window. Press Enter again to delete the output queue. Press F12 if you want to cancel the delete.
    2. The Update Local & Remote OUTQ window appears with a message of "Please wait...". This procedure checks & verifies all the OUTQ action that need to occur (e.g. Create, Change or Delete OUTQ in the Source or/and Target machine.)
    3. The source output queue is checked first. The source output queue is deleted if the user entered B or S in step 3. The target output queue in the target machine is deleted if the user entered B or T in step 3.
    4. The list of source entry is updated.

    Download Source

    Back to AS/400 Journal

    This page hosted by Get your own Free Home Page