CLP
/*-------------------------------------------------------------------*/
/* */
/* Program . . : CBX126V */
/* Description : Manage journal receiver command - VCP */
/* Author . . : Carsten Flensburg */
/* Published . : Club Tech iSeries Programming Tips Newsletter */
/* Date . . . : October 28, 2004 */
/* */
/* Program function: Check existence of parameter JRN - Journal */
/* */
/* */
/* Programmer's notes: */
/* The CPD0006 diagnostic message followed by a CPF0002 escape */
/* message is mandatory for a command validity checking program. */
/* */
/* */
/* Compile options: */
/* CrtClPgm Pgm( CBX126V ) */
/* SrcFile( QCLSRC ) */
/* SrcMbr( *PGM ) */
/* */
/*-------------------------------------------------------------------*/
Pgm ( &PxJrnQ +
&PxSavOfs +
&PxDays +
&PxRetain +
&PxRcvSts +
&PxOption +
&PxForce +
)
/*-- Parameters: ---------------------------------------------------*/
Dcl &PxJrnQ *Char 20
Dcl &PxSavOfs *Char 15
Dcl &PxDays *Char 2
Dcl &PxRetain *Char 2
Dcl &PxRcvSts *Char 3
Dcl &PxOption *Char 3
Dcl &PxForce *Char 3
/*-- Global variables: ---------------------------------------------*/
Dcl &JrnNam *Char 10
Dcl &JrnLib *Char 10
Dcl &Msg *Char 80
/*-- Global error monitoring: --------------------------------------*/
MonMsg CPF0000 *N GoTo Error
/*-- Mainline -------------------------------------------------------*/
ChgVar &JrnNam %Sst( &PxJrnQ 1 10 )
ChgVar &JrnLib %Sst( &PxJrnQ 11 10 )
RtvObjD Obj( &JrnLib/&JrnNam ) +
ObjType( *JRN ) +
RtnLib( &JrnLib )
/*-- End of program -------------------------------------------------*/
Return:
Return
/*-- Error processor ------------------------------------------------*/
Error:
RcvMsg MsgType( *EXCP ) +
Msg( &Msg )
ChgVar &Msg ( '0000' *Cat &Msg )
SndPgmMsg MsgId( CPD0006 ) +
MsgF( QCPFMSG ) +
MsgDta( &Msg ) +
MsgType( *DIAG )
SndPgmMsg MsgId( CPF0002 ) +
MsgF( QCPFMSG ) +
MsgType( *ESCAPE )
EndPgm:
EndPgm
阅读(1230) | 评论(0) | 转发(0) |