Return to the iSeriesTools Tips
FNDMSGFT - Find text in message File.
/*********************************************************************/ /* Program: FNDMSGFT */ /* */ /* Author: Poul Aschenbrenner, COOP Data */ /* */ /* Function: Find text in message File. */ /* */ /* Parm: 1. Search Text */ /* 2. Message File */ /*********************************************************************/ PGM PARM(&TXT &MSGF) DCL VAR(&TXT) TYPE(*CHAR) LEN(20) DCL VAR(&CMD) TYPE(*CHAR) LEN(100) DCL VAR(&MSGF) TYPE(*CHAR) LEN(20) DCL VAR(&LIBF) TYPE(*CHAR) LEN(21) CHGVAR VAR(&LIBF) VALUE(%SST(&MSGF 11 10) *TCAT '/' + *TCAT %SST(&MSGF 1 10)) CRTPF FILE(QTEMP/FNDMSGF) RCDLEN(266) SIZE(*NOMAX) MONMSG MSGID(CPF0000) CHGVAR VAR(&CMD) VALUE('system "DSPMSGD + RANGE(*FIRST *LAST) ' *CAT 'MSGF(' *CAT + &LIBF *CAT ') DETAIL(*BASIC)" | grep "' + *CAT &TXT *TCAT '"') OVRDBF FILE(STDOUT) TOFILE(QTEMP/FNDMSGF) STRQSH CMD(&CMD) DSPPFM FILE(QTEMP/FNDMSGF) ENDPGM /*********************************************************************/ /* Command: FNDMSGFT */ /*********************************************************************/ CMD PROMPT('Find Text in Message File') PARM KWD(TXT) TYPE(*CHAR) LEN(20) MIN(0) + CASE(*MIXED) CHOICE('Text, generic*') + PROMPT('Search Text') PARM KWD(FILE) TYPE(QFILE) MIN(1) PROMPT('Message File') QFILE: QUAL TYPE(*NAME) LEN(10) DFT(QCPFMSG) EXPR(*YES) QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) + SPCVAL((*LIBL) (*CURLIB)) EXPR(*YES) + PROMPT('Library')
[report a broken link by clicking here]