Appendix C. AIX administrative client in OS/400 PASE sample programs 405
/**/
IF COND(&TSMVOLON = '*YES') THEN(DO)
/**/
CALL PGM(TSMVOLON) PARM(&CPYPOOL)
MONMSG MSGID(CPF0000)
/**/
ENDDO
/*----------------------------------------------------------------*/
/**/
IF COND(&MOVMEDTSM = '*YES') THEN(DO)
/*----------------------------------------------------------------*/
/* Delay job 1 mins to allow for TSM to update BRMS files before */
/* running the BRMS MOVMEDBRM command */
/*----------------------------------------------------------------*/
DLYJOB DLY(60)
/**/
CALL PGM(MOVMEDTSM) PARM(&BRMMOVPCY)
MONMSG MSGID(CPF0000)
/**/
ENDDO
/**/
ENDPGM
Sample code for the STRMNTTSM command
CMD PROMPT('Start Maintenance for ITSM')
PARM KWD(TSMDBBOFF) TYPE(*CHAR) LEN(4) RSTD(*YES) +
DFT(*YES) VALUES('*YES' '*NO') +
PROMPT('ITSM Database Tapes to Offsite')
PARM KWD(TSMCPYOFF) TYPE(*CHAR) LEN(4) RSTD(*YES) +
DFT(*YES) VALUES('*YES' '*NO') +
PROMPT('ITSM Copypool Tapes to Offsite')
PARM KWD(TSMVOLON) TYPE(*CHAR) LEN(4) RSTD(*YES) +
DFT(*YES) VALUES('*YES' '*NO') +
PROMPT('ITSM Expired Tapes to Onsite')
PARM KWD(MEDIACLS) TYPE(*CHAR) LEN(10) RSTD(*NO) +
PROMPT('ITSM Database Device Class')
PARM KWD(CPYPOOL) TYPE(*CHAR) LEN(30) RSTD(*NO) +
PROMPT('ITSM Copy Storage Pool Name')
PARM KWD(BRMMOVPCY) TYPE(*CHAR) LEN(10) RSTD(*NO) +
DFT(TSMOFFSITE) PROMPT('BRMS Move Policy +
for ITSM')
PARM KWD(MOVMEDBRM) TYPE(*CHAR) LEN(4) RSTD(*YES) +
DFT(*YES) VALUES('*YES' '*NO') +
PROMPT('Run MOVMEDBRM for ITSM tapes')
Sample code for the TSMDBBOFF program
/*----------------------------------------------------------------*/
/* Program TSMDBBOFF */
/*----------------------------------------------------------------*/
/* */
PGM PARM(&BRMMOVPCY &MEDIACLS)
DCLF FILE(QTEMP/TSMTAPE)
DCL VAR(&BRMMOVPCY) TYPE(*CHAR) LEN(10)
DCL VAR(&MEDIACLS) TYPE(*CHAR) LEN(10)
DCL VAR(&TAPE) TYPE(*CHAR) LEN(6)
DCL VAR(&DEVCLASS) TYPE(*CHAR) LEN(10)
406 Integrating Backup Recovery and Media Services and IBM Tivoli Storage Manager
DCL VAR(&LOCATION) TYPE(*CHAR) LEN(10)
DCL VAR(&CMD1) TYPE(*CHAR) LEN(180) +
VALUE('"select +
volume_name,devclass,location from +
volhistory where type=''BACKUPFULL'' > +
/tmp/tsmdbboff.txt"')
DCL VAR(&CMD2) TYPE(*CHAR) LEN(180) VALUE('"upd +
volh xxxxxx devc=xxxxxxxxxx +
location=''OFFSITE''"')
CHGCURDIR DIR(/)
MONMSG MSGID(CPF0000)
/*----------------------------------------------------------------*/
/* Remove temp work files from IFS */
/*----------------------------------------------------------------*/
RMVLNK OBJLNK('/tmp/tsmdbboff.txt')
MONMSG MSGID(CPF0000)
/*----------------------------------------------------------------*/
/* Create temp work files */
/*----------------------------------------------------------------*/
/* */
CRTPF FILE(QTEMP/TSMTAPE) RCDLEN(133)
MONMSG MSGID(CPF0000)
/* */
CPYTOSTMF +
FROMMBR('/QSYS.LIB/QTEMP.LIB/TSMTAPE.FILE/T+
SMTAPE.MBR') TOSTMF('/tmp/tsmdbboff.txt') +
STMFOPT(*REPLACE)
MONMSG MSGID(CPF0000)
/* */
/*----------------------------------------------------------------*/
/* Query ITSM for DB backups ready to move offsite */
/*----------------------------------------------------------------*/
/* */
RUNTSMCMD TSMCMD(&CMD1)
MONMSG MSGID(CPF0000)
CPYFRMSTMF FROMSTMF('/tmp/tsmdbboff.txt') +
TOMBR('/QSYS.LIB/QTEMP.LIB/TSMTAPE.FILE/TSM+
TAPE.MBR') MBROPT(*REPLACE) STMFCODPAG(819)
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ENDPGM))
/*----------------------------------------------------------------*/
/* Assign BRMS move policy to ITSM database tapes and update the */
/* the location parameter in ITSM */
/*----------------------------------------------------------------*/
START: RCVF
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDPGM))
/**/
CHGVAR VAR(&TAPE) VALUE(%SST(&TSMTAPE 1 6))
CHGVAR VAR(&DEVCLASS) VALUE(%SST(&TSMTAPE 24 10))
CHGVAR VAR(&LOCATION) VALUE(%SST(&TSMTAPE 45 10))
/**/
IF COND((&MEDIACLS *EQ &DEVCLASS) *AND +
(&LOCATION *EQ ' ')) THEN(DO)
/**/
CHGMEDBRM VOL(&TAPE) MEDCLS(*SAME) +

Get Integrating Backup Recovery and Media Services and IBM Tivoli Storage Manager on the IBM eServer iSeries Server now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.