|
<<SNIP>>
This is a stripped-down example program. It will work on a single
object at a time, not the entire library-- If you want to fix the
authority for every object you won't have more than one object under
repair at once.
Make a copy of the file QADSPOBJ from QSYS into a work library (I named
this file QAFIXAUTH). The reason you make a copy is because I didn't
and fouled things up once-- I had 2 programs, program A called program
B, and both of them needed to DSPOBJD to an outfile. My habit had been
to DCLF QADSPOBJ then OVRDBF QADSPOBJ to the file I used in that
program. This caused all sorts of fun and frolic when programs A and B
were competing for the file! DON'T DO THIS!!
PGM
DCLF QAFIXAUTH
/* this is a copy of QADSPOBJ from QSYS (output from DSPOBJD) */
DSPOBJD OBJ(YOURLIB/*ALL) OBJTYPE(*FILE) DETAIL(*SERVICE) +
OUTPUT(*OUTFILE) OUTFILE(QTEMP/QAFIXAUTH)
/* notice the outfile has the 'right' name but is in QTEMP */
OVRDBF FILE(QAFIXAUTH) TOFILE(QTEMP/QAFIXAUTH) SECURE(*YES)
/* this leaves your original file QAFIXAUTH intact (and empty), +
and uses the copy in QTEMP for its work area */
LOOP:
RCVF
MONMSG MSGID(CPF0000) EXEC(RETURN)
/* optional--> RVKOBJAUT OBJ(&ODLBNM/&ODOBNM) OBJTYPE(&ODOBTP) USER(*ALL) AUT(*ALL) */
/* optional--> CHGOBJOWN OBJ(&ODLBNM/&ODOBNM) OBJTYPE(&ODOBTP) NEWOWN(YOUROBJOWNR) */
GRTOBJAUT OBJ(&ODLBNM/&ODOBNM) OBJTYPE(&ODOBTP) AUTL(YOURAUTL)
GRTOBJAUT OBJ(&ODLBNM/&ODOBNM) OBJTYPE(&ODOBTP) USER(*PUBLIC) AUT(*AUTL)
GOTO LOOP
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.