/*-------------------------------------------------------------------*/
/*                                                                   */
/*  Program . . : CBX3031M                                           */
/*  Description : Workload Capping Subsystem - Build commands        */
/*  Author  . . : Carsten Flensburg                                  */
/*                                                                   */
/*                                                                   */
/*  Program function:  Compiles, creates and configures all the      */
/*                     Workload Capping Subsystem 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.                       */
/*                                                                   */
/*                                                                   */
/*  NOTE: Beginning with release 7.3 workload capping is configured  */
/*        directly as a subsystem object attribute using the Create  */
/*        Subsystem Description (CRTSBSD) command or the Change      */
/*        Change Subsystem Description (CHGSBSD).                    */
/*                                                                   */
/*        The data area QWTWLCGRP in library QSYS will only work     */
/*        for release 7.1 and 7.2.                                   */
/*                                                                   */
/*        PTFs were issued to allow generic subsystem names to be    */
/*        specified in the QWTWLCGRP data area:                      */
/*          R710 SI57866 PTF - 6120                                  */
/*          R720 SI57867 PTF - 6127                                  */
/*                                                                   */
/*                                                                   */
/*  Compile options:                                                 */
/*    CrtClPgm    Pgm( CBX3031M )                                    */
/*                SrcFile( QCLSRC )                                  */
/*                SrcMbr( *PGM )                                     */
/*                                                                   */
/*-------------------------------------------------------------------*/
     Pgm    &UtlLib

     Dcl    &UtlLib         *Char     10

     MonMsg      CPF0000    *N        GoTo Error


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

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


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

     CrtPgm      &UtlLib/CBX3031V                +
                 Module( &UtlLib/CBX3031V )      +
                 ActGrp( *CALLER )


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


     CrtCmd      Cmd( &UtlLib/ADDWLCSBS )                       +
                 Pgm( CBX3031 )                                 +
                 SrcFile( &UtlLib/QCMDSRC )                     +
                 SrcMbr( CBX3031X )                             +
                 VldCkr( CBX3031V )                             +
                 HlpPnlGrp( CBX3031H )                          +
                 HlpId( *CMD )


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

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

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


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

     CrtPgm      &UtlLib/CBX3032V                +
                 Module( &UtlLib/CBX3032V )      +
                 ActGrp( *CALLER )


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


     CrtCmd      Cmd( &UtlLib/RMVWLCSBS )                       +
                 Pgm( CBX3032 )                                 +
                 SrcFile( &UtlLib/QCMDSRC )                     +
                 SrcMbr( CBX3032X )                             +
                 VldCkr( CBX3032V )                             +
                 HlpPnlGrp( CBX3032H )                          +
                 HlpId( *CMD )


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

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

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


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

     CrtPgm      &UtlLib/CBX3033V                +
                 Module( &UtlLib/CBX3033V )      +
                 ActGrp( *CALLER )

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

     CrtPgm      &UtlLib/CBX3033E                +
                 Module( &UtlLib/CBX3033E )      +
                 ActGrp( *CALLER )


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


     CrtCmd      Cmd( &UtlLib/WRKWLCSBS )                       +
                 Pgm( CBX3033 )                                 +
                 SrcFile( &UtlLib/QCMDSRC )                     +
                 SrcMbr( CBX3033X )                             +
                 VldCkr( CBX3033V )                             +
                 HlpPnlGrp( CBX3033H )                          +
                 HlpId( *CMD )


     SndPgmMsg   Msg( 'Work with WLC Subsystem 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
