|
> Hi, > is there an easy way to do a dspobjaut for all objects in a library? I > especially would need to find all objects which aren't secured by a > specific authority list. > Or which objects have *public *change/*all authority. Oliver, Here is a simple command and its command-processing-program (CLP) that I wrote to display the authorities of all objects in a library to one outfile. Command DSPAUTLIB: /********************************************************************/ /* */ /* DISPLAY AUTHORITY OF ALL OBJECTS IN A LIBRARY */ /* */ /********************************************************************/ CMD PROMPT('Display Aut for all obj in Lib') /* Source member name */ PARM KWD(LIBRARY) TYPE(*NAME) MIN(1) + PROMPT('Library name:') /* Qualified source file name */ PARM KWD(OUTFILE) TYPE(OUTFILE1) SNGVAL((*NONE)) + PROMPT('OutFile name:') OUTFILE1: QUAL TYPE(*NAME) DFT(OBJAUT) QUAL TYPE(*NAME) LEN(10) DFT(QTEMP) + SPCVAL((*LIBL)) PROMPT('Library name:') Command-processing program for DSPAUTLIB: /********************************************************************/ /* */ /* DISPLAY AUTHORITY OF ALL OBJECTS IN A LIBRARY */ /* */ /********************************************************************/ PGM PARM(&LIBRARY &QUALFILE) DCL VAR(&LIBRARY) TYPE(*CHAR) LEN(10) /* + Parameter 1 */ DCL VAR(&QUALFILE) TYPE(*CHAR) LEN(20) /* + Parameter 2 */ DCL VAR(&OUTFILE) TYPE(*CHAR) LEN(10) DCL VAR(&OUTFILELIB) TYPE(*CHAR) LEN(10) DCL VAR(&ERRORSW) TYPE(*LGL) /* Std err */ DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) /* Std err */ DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(100) /* Std err */ DCL VAR(&MSGF) TYPE(*CHAR) LEN(10) /* Std err */ DCL VAR(&MSGFLIB) TYPE(*CHAR) LEN(10) /* Std err */ DCLF FILE(QADSPOBJ) MONMSG MSGID(CPA0000 CPD0000 CPF0000) EXEC(GOTO + CMDLBL(STDERR1)) /* Std err */ CHGVAR VAR(&OUTFILELIB) VALUE(%SST(&QUALFILE 11 10)) CHGVAR VAR(&OUTFILE) VALUE(%SST(&QUALFILE 1 10)) STEP10: CHKOBJ OBJ(QSYS/&LIBRARY) OBJTYPE(*LIB) /* Check + for library existence */ DLTF FILE(QTEMP/QADSPOBJ) MONMSG MSGID(CPF0000) DSPOBJD OBJ(&LIBRARY/*ALL) OBJTYPE(*ALL) + OUTPUT(*OUTFILE) OUTFILE(QTEMP/QADSPOBJ) + /* Display list of objects to outfile in + QTEMP */ OVRDBF FILE(QADSPOBJ) TOFILE(QTEMP/QADSPOBJ) STEP50: RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(STEP99)) DSPOBJAUT OBJ(&ODLBNM/&ODOBNM) OBJTYPE(&ODOBTP) + OUTPUT(*OUTFILE) + OUTFILE(&OUTFILELIB/&OUTFILE) + OUTMBR(*FIRST *ADD) GOTO CMDLBL(STEP50) STDERR1: /* Standard error handling routine */ IF COND(&ERRORSW) THEN(SNDPGMMSG MSGID(CPF9999) + MSGF(QCPFMSG) MSGTYPE(*ESCAPE)) /* Func + chk */ CHGVAR VAR(&ERRORSW) VALUE('1') /* Set to fail ir + error occurs */ STDERR2: RCVMSG MSGTYPE(*DIAG) MSGDTA(&MSGDTA) MSGID(&MSGID) + MSGF(&MSGF) MSGFLIB(&MSGFLIB) IF COND(&MSGID *EQ ' ') THEN(GOTO + CMDLBL(STDERR3)) SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) + MSGDTA(&MSGDTA) MSGTYPE(*DIAG) GOTO CMDLBL(STDERR2) /* Loop back for addl + diagnostics */ STDERR3: RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) + MSGF(&MSGF) MSGFLIB(&MSGFLIB) SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) + MSGDTA(&MSGDTA) MSGTYPE(*ESCAPE) STEP99: DLTOVR FILE(*ALL) RCLRSC ENDPGM Hope this helps, Steve Landess Austin, Texas (512) 423-0935
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.