      /IF NOT DEFINED(DQCOPY)
      /DEFINE DQCOPY
     /*                                                                    +
      *                                                                    +
      * Copyright (c) 2009 Rory Hewitt                                     +
      * All rights reserved.                                               +
      *                                                                    +
      * Redistribution and use in source and binary forms, with or without +
      * modification, are permitted provided that the following conditions +
      * are met:                                                           +
      * 1. Redistributions of source code must retain the above copyright  +
      *    notice, this list of conditions and the following disclaimer.   +
      * 2. Redistributions in binary form must reproduce the above         +
      *    copyright notice, this list of conditions and the following     +
      *    disclaimer in the documentation and/or other materials provided +
      *    with the distribution.                                          +
      *                                                                    +
      * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ''AS IS'' +
      * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED  +
      * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A    +
      * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR   +
      * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,    +
      * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT   +
      * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF   +
      * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED    +
      * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT        +
      * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN  +
      * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE    +
      * POSSIBILITY OF SUCH DAMAGE.                                        +
      *                                                                    +
      */

      * Data Queue Server variables

     D DQ_qHandler     DS                  Inz Qualified
     D   Pgm                         10A
     D   Lib                         10A
     D DQ_sHandler     S             21A   Inz
     D DQ_qDtaq        DS                  Inz Qualified
     D   Dtaq                        10A
     D   Lib                         10A
     D DQ_sDtaq        S             21A   Inz
     D DQ_Key          S             16A   Inz
     D DQ_Data         S           5000A   Inz
     D DQ_qSendJob     DS                  Inz Qualified
     D   Name                        10A
     D   User                        10A
     D   Number                       6A
     D DQ_Action       S             10A   Inz
     D DQ_RtnCde       S              7A   Inz
     D DQ_QDFTDQHDLR   DS                  Qualified
     D   Pgm                         10A   Inz('DQHDLR')
     D   Lib                         10A   Inz('*LIBL')

      * Prototype for Data Queue Server DQSVR

     D DQServer        PR                  Extpgm('DQSVR')
     D   Action                            Const Like(DQ_Action)
     D   qDtaq                             Const Likeds(DQ_qDtaq)
     D   DtaqKey                           Const Like(DQ_Key)
     D   qHandler                          Const Likeds(DQ_qHandler)
     D   Data                              Const Like(DQ_Data)
     D   RtnKey                                  Like(DQ_Key)

      * Prototype for default Data Queue Server handler DQHDLR

     D DQHandler       PR                  ExtPgm(DQ_sHandler)
     D   Key                               Const Like(DQ_Key)
     D   Data                              Const Like(DQ_Data)
     D   qSendJob                          Const Likeds(DQ_qSendJob)
     D   RtnCde                                  Like(DQ_RtnCde)

      * Valid values for ACTION parameter to DQSVR

     D DQ_START        C                   '*START'
     D DQ_END          C                   '*END'
     D DQ_SEND         C                   '*SEND'

      /ENDIF