> Tech > Figure 3B

Figure 3B

Tech - Par Renaud ROSSET - Publié le 24 juin 2010

Programme PrtObjAut1 de traitement de la commande PrtObjAut

/* =============================================================== */
/* = Program....... PrtObjAut1 = */
/* = Source type... CLP = */
/* = Type.......... Command processing program for PrtObjAut = */
/* = Description... Print Object Authorities = */
/* = --------------------------------------------------------- = */
/* = Parameters

Figure 3B

= */
/* = = */
/* = &Obj Input Qualified object name = */
/* = = */
/* = &ObjType Input Object type = */
/* =============================================================== */

Pgm (
&Obj
&ObjType
)

/* =============================================================== */
/* = Variable declarations = */
/* =============================================================== */
Dcl &Obj * Char ( 20 )
Dcl &ObjType * Char ( 10 )
Dcl &ObjName * Char ( 10 )
Dcl &MsgID * Char ( 7 )
Dcl &MsgF * Char ( 10 )
Dcl &MsgFLib * Char ( 10 )
Dcl &MsgDta * Char ( 100 )
Dcl &ErrorFlag *Lgl

/* =============================================================== */
/* = File declaration = */
/* =============================================================== */
DclF QADspObj

/* =============================================================== */
/* = Global error monitor = */
/* =============================================================== */
MonMsg ( CPF0000 MCH0000 ) Exec( +
GoTo Error )

/* =============================================================== */
/* = Retrieve list of objects to a file = */
/* =============================================================== */
ChgVar &ObjName ( %Sst( &Obj 1 10 ) )
ChgVar &ObjLib ( %Sst( &Obj 11 10 ) )
DspObjD Obj( &ObjLib/&ObjName ) +
ObjType( &ObjType ) +
Detail( *Basic ) +
Output( *OutFile ) +
OutFile( QTemp/ObjList )

/* =============================================================== */
/* = Read records in file ObjList and print authorities = */
/* =============================================================== */
OvrDbF File( QADspObj ) +
ToFile( QTemp/ObjList )

ReadBegin:

RcvF RcdFmt( QLiDObjD )
MonMsg ( CPF0864 ) Exec( +
GoTo Exit )
DspObjAut Obj( &ODLbNm/&ODObNm ) +
ObjType( &ODObTp ) +
Output( *Print )
GoTo ReadBegin

/* =============================================================== */
/* = Error handler = */
/* =============================================================== */
Error:
If ( &ErrorFlag ) +
Do
SndPgmMsg MsgID( CPF9897 ) +
MsgF( QSys/QCPFMsg ) +
MsgDta( ‘Error in PrtObjAut. See joblog.’ ) +
MsgType( *Escape )
MonMsg ( CPF0000 MCH0000 ) Exec( +
Return )
EndDo

ChgVar &ErrorFlag ( ‘1’ )

RcvMsg MsgType( *Excp ) +
MsgDta( &MsgDta ) +
MsgID( &MsgID ) +
MsgF( &MsgF ) +
MsgFLib( &MsgFLib )

MonMsg ( CPF0000 MCH0000 )

SndPgmMsg MsgID( &MsgID ) +
MsgF( &MsgFLib/&MsgF ) +
MsgDta( &MsgDta ) +
MsgType( *Escape )
MonMsg ( CPF0000 MCH0000 )

/* =============================================================== */
/* = Clean up and exit program = */
/* =============================================================== */
Exit:

DltF QTemp/ObjList
MonMsg ( CPF0000 MCH0000 )

/* =============================================================== */
/* = End of program = */
/* =============================================================== */
EndPgm

Téléchargez cette ressource

SIEM & PME : Comment construire la boîte noire de votre SI ?

SIEM & PME : Comment construire la boîte noire de votre SI ?

Passez à la cybersécurité proactive, transformez la collecte et l’analyse des logs en un bouclier dynamique contre les cybermenaces. Découvrez comment mettre en place une approche SIEM modulaire, évolutive et accessible, pour anticiper, détecter et réagir efficacement aux attaques.

Les plus consultés sur iTPro.fr

A lire aussi sur le site

À la une de la chaîne Tech