Article

FNDMSGDC--Command processing program for cmd FNDMSGD

Mark Kennedy
 /*                                                                     */
/*  Note:  Change the value below from "yourlibrary" to the name of    */
/*         library where you will keep the source PF that will         */
/*         contain the source member that holds the msg text.          */
/*         This also matches the value in program FNDMSGRC.            */
/*                                                                     */
/********************************************************************/
/*                                                                  */
/* Program Name:                                                    */
/* -------------                                                    */
/* FNDMSGDC  ...Find A Pre-existing Message Description             */
/*                                                                  */
/* Function:                                                        */
/* ---------                                                        */
/* Bring up all the messages from the message file to be            */
/*  able to use the power of SEU's searching to find a pre-         */
/*  existing message description.                                   */
/*                                                                  */
/* Parameters:                                                      */
/* -----------                                                      */
/*   MSGF                                                           */
/*     The message file whos list is being searched.                */
/*                                                                  */
/*   REBUILD - Rebuild the the current list of messages             */
/*     *ON to rebuild the list                                      */
/*     *OFF to skip the rebuild section                             */
/*                                                                  */
/*                                                                  */
/********************************************************************/

             PGM        PARM(&MSGFFULL &REBUILD)

             DCL        VAR(&MSGFFULL) TYPE(*CHAR) LEN(20)
             DCL        VAR(&MSGF) TYPE(*CHAR) LEN(10)
             DCL        VAR(&MSGFLIB) TYPE(*CHAR) LEN(10)
             DCL        VAR(&REBUILD) TYPE(*LGL)


/* Parse out the message file name and library from the input       */
/* parameter                                                        */
             CHGVAR     VAR(&MSGF) VALUE(%SST(&MSGFFULL 01 10))
             CHGVAR     VAR(&MSGFLIB) VALUE(%SST(&MSGFFULL 11 10))

/* If the source file doesn't exist, force the rebuild              */
             CHKOBJ     OBJ(yourlibrary/QTXTSRC160) OBJTYPE(*FILE)
             MONMSG     MSGID(CPF9801) EXEC(CHGVAR VAR(&REBUILD) +
                          VALUE('1'))

             IF         COND(&REBUILD) THEN(DO)
             FNDMSGR    MSGF(&MSGFLIB/&MSGF)
             ENDDO

             STRSEU     SRCFILE(yourlibrary/QTXTSRC160) SRCMBR(&MSGF) +
                          OPTION(5)