Code to display one user profile's own storage:
==================================================================================================
MY_STG_001
==================================================================================================
/*************************************************************************/
/* */
/* Storage view per user profile */
/* */
/* Initial Coding: Thibault Dambrine */
/* Date : 2008/10/23 */
/*************************************************************************/
PGM PARM(&OWNER)
DCL VAR(&OWNER) TYPE(*CHAR) LEN(10)
DLTF FILE(QTEMP/OWNEDOBJ)
MONMSG MSGID(CPF0000)
DSPUSRPRF USRPRF(&OWNER) TYPE(*OBJOWN) +
OUTPUT(*OUTFILE) OUTFILE(QTEMP/OWNEDOBJ)
CALL MY_STG_002
ENDPGM
==================================================================================================
MY_STG_002
==================================================================================================
/*************************************************************************/
/* */
/* Storage view for EPB Items */
/* */
/* Initial Coding: Thibault Dambrine */
/* Date : 2008/10/23 */
/*************************************************************************/
PGM
DCLF FILE(QTEMP/OWNEDOBJ)
DLTF FILE(QTEMP/OBJOWNSIZ)
MONMSG MSGID(CPF0000)
LOOP: RCVF
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(EXIT))
DSPOBJD OBJ(&OOLIB/&OOOBJ) OBJTYPE(&OOTYPE) +
OUTPUT(*OUTFILE) OUTFILE(QTEMP/OBJOWNSIZ) +
OUTMBR(*FIRST *ADD)
MONMSG MSGID(CPF0000) /* not authorized or other problem */
GOTO CMDLBL(LOOP)
EXIT:
/* Granular view */
EXCSQL REQUEST('SELECT ODLBNM, ODOBNM, ODOBTP, +
ODOBSZ, ODCDAT, ODCTIM, ODCRTU , ODOBOW +
FROM QTEMP/OBJOWNSIZ ORDER BY ODOBSZ DESC')
/* User aggregate view */
EXCSQL REQUEST('SELECT ODCRTU, MIN(ODCDAT), +
SUM(ODOBSZ) FROM QTEMP/OBJOWNSIZ GROUP BY +
ODCRTU ORDER BY 3 DESC')
/* Library aggregate view */
EXCSQL REQUEST('SELECT ODLBNM, MIN(ODCDAT), +
MAX(ODCDAT), SUM( ODOBSZ) FROM +
QTEMP/OBJOWNSIZ GROUP BY ODLBNM ORDER BY +
4 DESC, 2, 3 ')