/*-------------------------------------------------------------------*/
/*                                                                   */
/*  Program . . : SEC103M                                            */
/*  Description : Add & Remove User Auditing - Create commands       */
/*  Author  . . : Carsten Flensburg                                  */
/*                                                                   */
/*                                                                   */
/*  Program function:  Compiles, creates and configures all the      */
/*                     Add User Auditing and Remove User Auditing    */
/*                     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( SEC103M )                                     */
/*                SrcFile( QCLSRC )                                  */
/*                SrcMbr( *PGM )                                     */
/*                                                                   */
/*-------------------------------------------------------------------*/
     Pgm    &UtlLib

     Dcl    &UtlLib         *Char     10

     MonMsg      CPF0000    *N        GoTo Error


     CrtMsgF     MsgF( &UtlLib/SEC103M )  Aut( *USE )

     AddMsgD     SEC0101                                             +
                 MsgF( &UtlLib/SEC103M )                             +
                 Msg( 'If AUDLVL(*NONE) is specified REPLACE(*YES) +
                       is required.' )                               +
                 SecLvl( *NONE )


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

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

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

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

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

     CrtCmd      Cmd( &UtlLib/ADDUSRAUD )                       +
                 Pgm( SEC1031 )                                 +
                 SrcFile( &UtlLib/QCMDSRC )                     +
                 SrcMbr( SEC1031X )                             +
                 VldCkr( SEC1031V )                             +
                 AlwLmtUsr( *NO )                               +
                 MsgF( SEC103M )                                +
                 HlpPnlGrp( SEC1031H )                          +
                 HlpId( *CMD )                                  +
                 Aut( *EXCLUDE )


     SndPgmMsg   Msg( 'Add User Auditing command'         *Bcat +
                      'successfully created in library'   *Bcat +
                      &UtlLib                             *Tcat +
                      '.' )                                     +
                 MsgType( *COMP )


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

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

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

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


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

     CrtCmd      Cmd( &UtlLib/RMVUSRAUD )                       +
                 Pgm( SEC1032 )                                 +
                 SrcFile( &UtlLib/QCMDSRC )                     +
                 SrcMbr( SEC1032X )                             +
                 VldCkr( SEC1032V )                             +
                 AlwLmtUsr( *NO )                               +
                 HlpPnlGrp( SEC1032H )                          +
                 HlpId( *CMD )                                  +
                 Aut( *EXCLUDE )


     SndPgmMsg   Msg( 'Remove User Auditing command'      *Bcat +
                      'successfully created in library'   *Bcat +
                      &UtlLib                             *Tcat +
                      '.' )                                     +
                 MsgType( *COMP )


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

     RmvMsg      Clear( *ALL )

     Return

/*-- Error handling:  -----------------------------------------------*/
 Error:
     Call        QMHMOVPM    ( '    '                 +
                               '*DIAG'                +
                               x'00000001'            +
                               '*PGMBDY'              +
                               x'00000001'            +
                               x'0000000800000000'    +
                             )

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

 EndPgm:
     EndPgm
