全部博文(287)
分类: 系统运维
2010-06-04 16:01:33
CBX107:
/* Description : Set profile exit program command */
/* Program function: SETPRFEXIT command processing program */
/* */
/* Program summary */
/* --------------- */
/* Work management APIs: */
/* QWTSETPX Set profile exit Sets for a user profile */
/* program the exit program to call */
/* defined by the specified */
/* format and the values of */
/* the exit flags. */
/* */
/* QWTRTVPX Retrieve profile Retrieves the values of */
/* exit program the exit flags currently */
/* set for the user profile */
/* and the exit point format */
/* specified. */
/* */
/* Programmer's notes: */
/* Currently supported by the profile exit APIs are the */
/* preattention and presystem request exit points */
/* QIBM_QWT_PREATTNPGMS respectively QIBM_QWT_SYSREQPGMS. */
/* Both are managed through either the WRKREGINF facility */
/* or the ADDEXITPGM and RMVEXITPGM commands. */
/* */
/* */
/* Compile options: */
/* CrtClPgm Pgm( CBX107 ) */
/* SrcFile( QCLSRC ) */
/* SrcMbr( *PGM ) */
/* */
/*-------------------------------------------------------------------*/
Pgm ( &UsrPrf +
&XitFmt +
&XitOpt +
)
/*-- Parameters: ---------------------------------------------------*/
Dcl &UsrPrf *Char 10
Dcl &XitFmt *Char 8
Dcl &XitOpt *Char 34
Dcl &PgmNbr *Char 4 x'00000008'
Dcl &Flags *Char 32
/*-- Global error monitoring: --------------------------------------*/
MonMsg CPF0000 *N GoTo Error
RtvUsrPrf &UsrPrf RtnUsrPrf( &UsrPrf )
ChgVar &Flags %Sst( &XitOpt 3 32 )
Call QWTSETPX ( &PgmNbr +
&Flags +
&XitFmt +
&UsrPrf +
x'00000000' +
)
SndPgmMsg Msg( 'Profile exit programs have been set.' ) +
MsgType( *COMP )
Return:
Return
/*-- Error handling: -----------------------------------------------*/
Error:
Call QMHMOVPM ( ' ' +
'*DIAG' +
x'00000001' +
'*PGMBDY' +
x'00000001' +
x'0000000800000000' +
)
Call QMHRSNEM ( ' ' +
x'0000000800000000' +
)
EndPgm:
EndPgm
CBX1070:
/*-------------------------------------------------------------------*/
/* */
/* Program function: SETPRFEXIT prompt override program */
/* */
/* */
/* Parameters: */
/* CmdNamQ INPUT Qualified command name */
/* */
/* KeyPrm1 INPUT Key parameter indentifying the */
/* user profile to retrieve exit */
/* point information about. */
/* */
/* KeyPrm2 INPUT Key parameter identifying the */
/* format name of the exit point */
/* to retrieve information about. */
/* */
/* CmdStr OUTPUT The formatted command prompt */
/* string returning the current */
/* activation status of the exit */
/* point's registered programs. */
/* */
/* */
/* Compile options: */
/* CrtClPgm Pgm( CBX107O ) */
/* SrcFile( QCLSRC ) */
/* SrcMbr( *PGM ) */
/* */
/* */
/*-------------------------------------------------------------------*/
Pgm ( &CmdNamQ +
&KeyPrm1 +
&KeyPrm2 +
&CmdStr +
)
/*-- Parameters: ---------------------------------------------------*/
Dcl &CmdNamQ *Char 20
Dcl &KeyPrm1 *Char 10
Dcl &KeyPrm2 *Char 8
Dcl &CmdStr *Char 1024
Dcl &RcvVar *Char 40
Dcl &RcvLen *Char 4 x'00000028'
Dcl &Flags *Char 32
Dcl &Value *Char 4
Dcl &PgmFlg *Dec 9
Dcl &NbrEnt *Dec 5
Dcl &OffSet *Dec 5 1
/*-- Global error monitoring: --------------------------------------*/
MonMsg CPF0000 *N GoTo Error
Call QWTRTVPX ( &RcvVar +
&RcvLen +
&KeyPrm2 +
&KeyPrm1 +
x'00000000' )
ChgVar &NbrEnt %Bin( &RcvVar 1 4 )
ChgVar &Flags %Sst( &RcvVar 9 32 )
ChgVar %Sst( &CmdStr 1 2 ) x'0040'
ChgVar %Sst( &CmdStr 3 10 ) '?#EXITPGM('
Next:
ChgVar &PgmFlg %Bin( &Flags &OffSet 4 )
If ( &PgmFlg = 1 ) ChgVar &Value '*ON '
Else ChgVar &Value '*OFF'
ChgVar &CmdStr ( &CmdStr *Bcat &Value )
ChgVar &OffSet ( &OffSet + 4 )
If ( &OffSet < &NbrEnt * 4 ) Do
GoTo Next
EndDo
ChgVar &CmdStr ( &CmdStr *Bcat ')' )
Return:
Return
/*-- Error handling: -----------------------------------------------*/
Error:
SndPgmMsg MsgId( CPF0011 ) MsgF( QCPFMSG ) MsgType( *ESCAPE )
EndPgm:
EndPgm
Pls note: '?#EXITPGM(' .... '#' neeeds to be changed to '<'
CBX107P:
.*-----------------------------------------------------------------------**
.*
.* Compile options:
.*
.* CrtPnlGrp PnlGrp( CBX107P )
.* SrcFile( QPNLSRC )
.* SrcMbr( *PNLGRP )
.*
.*-----------------------------------------------------------------------**
:PNLGRP.
:HELP NAME='SETPRFEXIT'.
Set Profile Exit Program - Help
:P.
The Set Profile Exit command (SETPRFEXIT) activates or deactivates for
the specified user profile, the exit program(s) registered for the exit
point defined by the format parameter.
:P.
The current setting is retrieved for the specified user profile if the
command is prompted prior to execution.
:EHELP.
:HELP NAME='SETPRFEXIT/USRPRF'.
User profile (USRPRF) - Help
:XH3.User profile (USRPRF)
:P.
Specifies the name of the user profile whose exit program setting you
want to change.
:P.
The possible values are:
:PARML.
:PT.:PV.user-name:EPV.
:PD.
The name of the user profile that you want to change the profile exit
program setting for.
:PT.:PK.*CURRENT:EPK.
:PD.
The user profile that is currently running is used.
:EPARML.
:EHELP.
:HELP NAME='SETPRFEXIT/FORMAT'.
Exit program format (FORMAT) - Help
:XH3.Exit program format (FORMAT)
:P.
The format name defines the specific exit program setting to change.
:P.
The possible values are:
:PARML.
:PT.:PK DEF.*SYSRQS:EPK.
:PD.
The presystem request program exit point setting is changed for the
specified user profile.
:PT.:PK.*ATTN:EPK.
:PD.
The preattention program exit point setting is changed for the
specified user profile.
:EPARML.
:EHELP.
:HELP NAME='SETPRFEXIT/EXITPGM'.
Exit program option (EXITPGM) - Help
:XH3.Exit program option (EXITPGM)
:P.
Specifies for the registered exit point programs in the order 1 to 8
if the corresponding exit program should be activated, deactivated or
have it's current setting remain unchanged.
:P.
The possible values are:
:PARML.
:PT.:PK.*SAME:EPK.
:PD.
The current setting remains unchanged for corresponding exit program.
:PT.:PK.*ON:EPK.
:PD.
The corresponding exit program is activated for the specified user
profile.
:PT.:PK.*OFF:EPK.
:PD.
The corresponding exit program is deactivated for the specified user
profile.
:EPARML.
:EHELP.
:EPNLGRP.
CBX107X:
/*-------------------------------------------------------------------*/
/* */
/* Compile options: */
/* */
/* CrtCmd Cmd( SETPRFEXIT ) */
/* Pgm( CBX107 ) */
/* SrcMbr( CBX107X ) */
/* HlpPnlGrp( CBX107P ) */
/* HlpId( *CMD ) */
/* PmtOvrPgm( CBX107O ) */
/* */
/*-------------------------------------------------------------------*/
Cmd Prompt( 'Set Profile Exit Program' )
Parm USRPRF *Name +
Min( 1 ) +
SpcVal(( *CURRENT )) +
Expr( *YES ) +
Keyparm( *YES ) +
Prompt( 'User profile' )
Parm FORMAT *Char 8 +
Rstd( *YES ) +
Dft( *SYSRQS ) +
SpcVal(( *SYSRQS SREQ0100 ) +
( *ATTN ATTN0100 )) +
Expr( *YES ) +
Keyparm( *YES ) +
Prompt( 'Exit program format' )
Parm EXITPGM E0001 +
Prompt( 'Exit program option' )
E0001: Elem *INT4 +
Rstd( *YES ) +
Dft( *SAME ) +
SpcVal(( *ON 1 ) ( *OFF 0 ) ( *SAME -1 )) +
Expr( *YES ) +
Prompt( 'Program 1' )
Elem *INT4 +
Rstd( *YES ) +
Dft( *SAME ) +
SpcVal(( *ON 1 ) ( *OFF 0 ) ( *SAME -1 )) +
Expr(*YES) +
Prompt( 'Program 2' )
Elem *INT4 +
Rstd( *YES ) +
Dft( *SAME ) +
SpcVal(( *ON 1 ) ( *OFF 0 ) ( *SAME -1 )) +
Expr( *YES ) +
Prompt( 'Program 3' )
Elem *INT4 +
Rstd( *YES ) +
Dft( *SAME ) +
SpcVal(( *ON 1 ) ( *OFF 0 ) ( *SAME -1 )) +
Expr( *YES ) +
Prompt( 'Program 4' )
Elem *INT4 +
Rstd( *YES ) +
Dft( *SAME ) +
SpcVal(( *ON 1 ) ( *OFF 0 ) ( *SAME -1 )) +
Expr( *YES ) +
Prompt( 'Program 5' )
Elem *INT4 +
Rstd( *YES ) +
Dft( *SAME ) +
SpcVal(( *ON 1 ) ( *OFF 0 ) ( *SAME -1 )) +
Expr( *YES ) +
Prompt( 'Program 6' )
Elem *INT4 +
Rstd( *YES ) +
Dft( *SAME ) +
SpcVal(( *ON 1 ) ( *OFF 0 ) ( *SAME -1 )) +
Expr( *YES ) +
Prompt( 'Program 7' )
Elem *INT4 +
Rstd( *YES ) +
Dft( *SAME ) +
SpcVal(( *ON 1 ) ( *OFF 0 ) ( *SAME -1 )) +
Expr( *YES ) +
Prompt( 'Program 8' )
Thanks to Carsten Flensburg