× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I was having a problem trying to figure out how to compile DDS menus in batch. 
I found several postings that said to use CRTMNU or even CRTDSPF, CRTMSGF and
CRTMNU, but, like others, I found that this was not sufficient to recreate what
SDA did when I recompiled a menu interactively. 


Finally I figured out that the missing command was ADDMSGD - that you need to
add a message description to the message file for each of the menu options.  So
I created the CL program below and it works like a champ for me.  You might need
to embellish it if your menu command source is more complicated.    Thought I
would share...

/* AS THE SOURCE FILE */
    PGM PARM(&SRCMBR &SRCFILE &SRCLIB)
    DCL &SRCMBR *CHAR 10
    DCL &SRCFILE *CHAR 10
    DCL &SRCLIB *CHAR 10
    DCL &MSGMBR *CHAR 10
    DCL &MSGID *CHAR 7
    DCL &MSG *CHAR 80
    DCLF FILE(ALLIANCE/QDDSSRC)
/* COMMANDS FOR MENU ARE IN MEMBER WITH QQ APPENDED TO MENU NAME */
    CHGVAR &MSGMBR VALUE(&SRCMBR *TCAT 'QQ')
/* DELETE AND RECREATE DISPLAY FILE */
    DLTF FILE(&SRCLIB/&SRCMBR)
    MONMSG MSGID(CPF0000)
    CRTDSPF FILE(&SRCLIB/&SRCMBR) +
      SRCFILE(&SRCLIB/&SRCFILE) SRCMBR(&SRCMBR)
/* DELETE AND RECREATE MESSAGE FILE */
    DLTMSGF MSGF(&SRCLIB/&SRCMBR)
    MONMSG MSGID(CPF0000)
    CRTMSGF MSGF(&SRCLIB/&SRCMBR)
    OVRDBF FILE(QDDSSRC) TOFILE(&SRCLIB/&SRCFILE) +
        MBR(&MSGMBR)
/* IGNORE FIRST RECORD OF COMMAND SOURCE */
    RCVF RCDFMT(QDDSSRC)
    MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(NEXT))
/* LOOP THRU COMMAND SOURCE AND ADDMSGD FOR EACH MENU OPTION */
    RCVF RCDFMT(QDDSSRC)
    MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(NEXT))
    DOWHILE (&SRCDTA *NE *NULL)
    CHGVAR &MSGID VALUE('USR' *CAT %SST(&SRCDTA 1 4))
    CHGVAR &MSG VALUE(%SST(&SRCDTA 6 75))
    ADDMSGD MSGID(&MSGID) MSGF(&SRCLIB/&SRCMBR) MSG(&MSG)
    RCVF RCDFMT(QDDSSRC)
    MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(NEXT))
    ENDDO
/* CREATE MENU AND TIE TO DSPF AND MSGF JUST CREATED */
NEXT: DLTMNU MENU(&SRCLIB/&SRCMBR)
    MONMSG MSGID(CPF0000)
    CRTMNU MENU(&SRCLIB/&SRCMBR) TYPE(*DSPF) +
      DSPF(&SRCLIB/*MENU) MSGF(&SRCLIB/*MENU) +
      DSPKEY(*YES)
    ENDPGM

.../* THIS PROGRAM COMPILES A DDS MENU INTO THE SAME LIBRARY */              
/* AS THE SOURCE FILE */
PGM PARM(&SRCMBR &SRCFILE &SRCLIB)
DCL &SRCMBR *CHAR 10
DCL &SRCFILE *CHAR 10
DCL &SRCLIB *CHAR 10
DCL &MSGMBR *CHAR 10
DCL &MSGID *CHAR 7
DCL &MSG *CHAR 80
DCLF FILE(ALLIANCE/QDDSSRC)
/* COMMANDS FOR MENU ARE IN MEMBER WITH QQ APPENDED TO MENU NAME */
CHGVAR &MSGMBR VALUE(&SRCMBR *TCAT 'QQ')
/* DELETE AND RECREATE DISPLAY FILE */
DLTF FILE(&SRCLIB/&SRCMBR)
MONMSG MSGID(CPF0000)
CRTDSPF FILE(&SRCLIB/&SRCMBR) +
SRCFILE(&SRCLIB/&SRCFILE) SRCMBR(&SRCMBR)
/* DELETE AND RECREATE MESSAGE FILE */
DLTMSGF MSGF(&SRCLIB/&SRCMBR)
MONMSG MSGID(CPF0000)
CRTMSGF MSGF(&SRCLIB/&SRCMBR)
OVRDBF FILE(QDDSSRC) TOFILE(&SRCLIB/&SRCFILE) +
MBR(&MSGMBR)
/* IGNORE FIRST RECORD OF COMMAND SOURCE */
RCVF RCDFMT(QDDSSRC)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(NEXT))
/* LOOP THRU COMMAND SOURCE AND ADDMSGD FOR EACH MENU OPTION */
RCVF RCDFMT(QDDSSRC)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(NEXT))
DOWHILE (&SRCDTA *NE *NULL)
CHGVAR &MSGID VALUE('USR' *CAT %SST(&SRCDTA 1 4))
CHGVAR &MSG VALUE(%SST(&SRCDTA 6 75))
ADDMSGD MSGID(&MSGID) MSGF(&SRCLIB/&SRCMBR) MSG(&MSG)
RCVF RCDFMT(QDDSSRC)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(NEXT))
ENDDO
/* CREATE MENU AND TIE TO DSPF AND MSGF JUST CREATED */
NEXT: DLTMNU MENU(&SRCLIB/&SRCMBR)
MONMSG MSGID(CPF0000)
CRTMNU MENU(&SRCLIB/&SRCMBR) TYPE(*DSPF) +
DSPF(&SRCLIB/*MENU) MSGF(&SRCLIB/*MENU) +
DSPKEY(*YES)
ENDPGM

...B/* THIS PROGRAM COMPILES A DDS MENU INTO THE SAME LIBRARY */

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.