Return to the ProgTips Tips
Add multiple Image File Entry to Image Catalog
/* Author: Poul Aschenbrenner */ /* E-mail: poul.aschenbrenner(at)coop(dot)dk */ /* */ /* Function: Add multiple Image File Entry to Image Catalog. */ /* Use system supplied file QUSRSYS/QAPEXDFN */ /* with Maximum record length = 80. */ /*********************************************************************/ PGM DCL VAR(&IMGCLG) TYPE(*CHAR) LEN(10) DCL VAR(&LNK) TYPE(*CHAR) LEN(80) DCL VAR(&CMD) TYPE(*CHAR) LEN(80) DCL VAR(&MSG) TYPE(*CHAR) LEN(80) DCL VAR(&PTFFILE) TYPE(*CHAR) LEN(80) DCLF FILE(QAPEXDFN) /* Override System supplied */ OVRDBF FILE(QAPEXDFN) TOFILE(QTEMP/ADDIMGCLG) + LVLCHK(*NO) /* Create ADDIMGCLG List File */ CRTPF FILE(QTEMP/ADDIMGCLG) RCDLEN(80) MONMSG MSGID(CPF0000) /* Setup variables */ CHGVAR VAR(&IMGCLG) VALUE('PTFCATALOG') CHGVAR VAR(&LNK) VALUE('/ptf54') /* List files in PTF link */ CHGVAR VAR(&CMD) VALUE('ls ' *CAT + &LNK) OVRDBF FILE(STDOUT) TOFILE(QTEMP/ADDIMGCLG) STRQSH CMD(&CMD) /* Add all files to Image Library */ RCVFILE: RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(EOF)) CHGVAR VAR(&PTFFILE) VALUE(&QAYPEDFN) ADDIMGCLGE IMGCLG(&IMGCLG) FROMFILE(&PTFFILE) + TOFILE(&PTFFILE) MONMSG MSGID(CPFBC28) EXEC(DO) CHGVAR VAR(&MSG) VALUE('Error in adding image + catalog file: ' *CAT &PTFFILE) SNDPGMMSG MSG(&MSG) GOTO CMDLBL(END) ENDDO GOTO CMDLBL(RCVFILE) EOF: SNDPGMMSG MSG('Multiple Image File Entry added to + Catalog...') END: ENDPGM
[report a broken link by clicking here]