用SQLRPGLE做行不行?
SELECT * FROM systables WHERE TABLE_SCHEMA ='*你要找的LIB'
自己把systables和你放LIB的PF做个外连接就行了.然后用QCMDEXC改权限
代码:
PGM PARM(&GETLIB)
DCL VAR(&GETLIB) TYPE(*CHAR) LEN(10)
DCLF FILE(DLDSES/GETLIBL4)
NEXT: RCVF RCDFMT(GETLIBL4)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
CHGVAR VAR(&GETLIB) VALUE(&LIBRARY)
CALL PGM(DLDSES/CHGAUT) PARM(&GETLIB)
GOTO CMDLBL(NEXT)
END: ENDPGM
PGM PARM(&GETLIB)
DCL VAR(&GETLIB) TYPE(*CHAR) LEN(10)
DCLF FILE(DLDSES/WORKFILE)
DSPOBJD OBJ(&GETLIB/*ALL) OBJTYPE(*ALL) +
OUTPUT(*OUTFILE) OUTFILE(DLDSES/WORKFILE)
NEXT: RCVF RCDFMT(QLIDOBJD)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
GRTOBJAUT OBJ(&GETLIB/&ODOBNM) OBJTYPE(*ALL) +
USER(DLPBACKUP) AUT(*USE) REPLACE(*YES)
GOTO CMDLBL(NEXT)
END: ENDPGM