/*-------------------------------------------------------------------*/
/*                                                                   */
/*  Program . . : SEC100M                                            */
/*  Description : Verify Query Output File - Create command          */
/*  Author  . . : Carsten Flensburg                                  */
/*                                                                   */
/*                                                                   */
/*  Program function:  Compiles, creates and configures all the      */
/*                     Verify Query Output File command objects.     */
/*                                                                   */
/*                     This program expects a single parameter       */
/*                     specifying the library to contain the         */
/*                     command objects.                              */
/*                                                                   */
/*                     Object sources must exist in the respective   */
/*                     source type default source files in the       */
/*                     command object library.                       */
/*                                                                   */
/*                                                                   */
/*  Compile options:                                                 */
/*    CrtClPgm    Pgm( SEC100M )                                     */
/*                SrcFile( QCLSRC )                                  */
/*                SrcMbr( *PGM )                                     */
/*                                                                   */
/*-------------------------------------------------------------------*/
     Pgm    &UtlLib

     Dcl    &UtlLib         *Char     10
     Dcl    &CurLib         *Char     10

     MonMsg      CPF0000    *N        GoTo Error

     RtvJobA     CurLib( &CurLib )

     If        ( &CurLib = '*NONE' )  ChgVar     &CurLib   '*CRTDFT'

     ChgCurLib   &UtlLib


     CrtRpgMod   &UtlLib/SEC100                  +
                 SrcFile( &UtlLib/QRPGLESRC )    +
                 SrcMbr( *Module )               +
                 DbgView( *LIST )

     CrtPgm      &UtlLib/SEC100                  +
                 Module( &UtlLib/SEC100 )        +
                 ActGrp( *NEW )

     CrtClPgm    Pgm( &UtlLib/SEC100T )          +
                 SrcFile( &UtlLib/QCLSRC )       +
                 SrcMbr( *PGM )


     CrtPnlGrp   &UtlLib/SEC100H                 +
                 SrcFile( &UtlLib/QPNLSRC )      +
                 SrcMbr( *PNLGRP )


     CrtCmd      Cmd( &UtlLib/VFYQRYOUTF )                      +
                 Pgm( SEC100 )                                  +
                 SrcFile( &UtlLib/QCMDSRC )                     +
                 SrcMbr( SEC100X )                              +
                 Allow(( *IPGM  ) ( *BPGM  )                    +
                       ( *IREXX ) ( *BREXX ))                   +
                 HlpPnlGrp( SEC100H )                           +
                 HlpId( *CMD )                                  +
                 PrdLib( &UtlLib )


     SndPgmMsg   Msg( 'Verify Query Output File command'  *Bcat +
                      'successfully created in library'   *Bcat +
                      &UtlLib                             *Tcat +
                      '.' )                                     +
                 MsgType( *COMP )


     Call        QMHMOVPM    ( '    '                 +
                               '*COMP'                +
                               x'00000001'            +
                               '*PGMBDY'              +
                               x'00000001'            +
                               x'0000000800000000'    +
                             )

     RmvMsg      Clear( *ALL )

     ChgCurLib   CurLib( &CurLib )

     Return

/*-- Error handling:  -----------------------------------------------*/
 Error:
     ChgCurLib   CurLib( &CurLib )
     MonMsg      CPF0000

     Call        QMHMOVPM    ( '    '                 +
                               '*DIAG'                +
                               x'00000001'            +
                               '*PGMBDY'              +
                               x'00000001'            +
                               x'0000000800000000'    +
                             )

     Call        QMHRSNEM    ( '    '                 +
                               x'0000000800000000'    +
                             )

 EndPgm:
     EndPgm
