IBM i Custom Main Menu

The easiest way to create a new menu for the IBM i is to use the Screen Design Aid (SDA). To get started create a source physical file to hold the menu source in your current library.

CRTSRCPF FILE(QMNUSRC) TEXT('Menu Source')

Next, start PDM using the STRPDM command. Take option 3. Work with members. Select CURLIB/*QMNUSRC as your member to work with. Press F6 and create two new members. One called MYMAIN and another called MYMAINQQ. MYMAIN will have a type of MNUDDS. MYMAINQQ will have a type of MNUCMD. Once you create MYMAIN take option 17 on the member. Say yes to work with menu image and commands. When using the SDA press F10 to work with commands. When you are done press F3 to exit. Accept the options to create the menu in your current library. Now you should be able to issue a GO command to visit your menu. Once you go to the menu, press F23 to set it as your home menu.

Here is the MNUDDS of my main menu. Note it is pretty messy as that is what SDA outputs. There are some additional fields I've added in the source such as DATE, TIME, USER which dynamically populate:

     A                                      DSPSIZ(24 80 *DS3
     A                                             27 132 *DS4)
     A                                      CHGINPDFT
     A                                      INDARA
     A                                      PRINT(*LIBL/QSYSPRT)
     A          R MYMAIN
     A                                      DSPMOD(*DS3)
     A                                      LOCK
     A                                      SLNO(01)
     A                                      CLRL(*ALL)
     A                                      ALWROL
     A                                      CF03
     A                                      HELP
     A                                      HOME
     A                                      HLPRTN
     A                                  1  2'MYMAIN'
     A                                      COLOR(BLU)
     A                                  1 36'Main Menu'
     A                                      DSPATR(HI)
     A                                  1 60DATE
     A                                      EDTCDE(Y)
     A                                      DSPATR(HI)
     A                                      COLOR(BLU)
     A                                  1 69TIME
     A                                      DSPATR(HI)
     A                                      COLOR(BLU)
     A                                  1  9USER
     A                                      DSPATR(HI)
     A                                      COLOR(BLU)
     A                                  3  2'Select one of the following:'
     A                                      COLOR(BLU)
     A                                  5  7'1.'
     A                                  6  7'2.'
     A                                  7  7'3.'
     A                                  8  7'4.'
     A                                  9  7'5.'
     A                                 10  7'6.'
     A                                 11  7'7.'
     A                                 12  7'8.'
     A                                 13  7'9.'
     A                                 14  6'10.'
     A* CMDPROMPT  Do not delete this DDS spec.
     A                                019  2'Selection or Command              -
     A                                          '
     A                                  5 10'Start'
     A                                  5 16'PDM'
     A                                  6 10'Start'
     A                                  6 16'DFU'
     A                                  7 10'Start'
     A                                  7 16'SDA'
     A                                  8 10'Work'
     A                                  8 15'with'
     A                                  8 20'IFS'
     A                                  8 24'Links'
     A                                  9 10'Call'
     A                                  9 15'Rexx'
     A                                  9 20'Procedure'
     A                                 10 10'Start'
     A                                 10 16'IBM'
     A                                 10 20'Data'
     A                                 10 25'Studio'
     A                                 11 10'Interactive'
     A                                 11 22'SQL'
     A                                 12 10'Start'
     A                                 12 16'Query'
     A                                 12 22'Manager'
     A                                 13 10'QShell'
     A                                 14 10'IBM'
     A                                 14 14'Main'
     A                                 14 19'Menu'
     A                                  1 78'UTC'
     A                                      COLOR(BLU)
     A                                 16  6'90. Sign Off'

Here is the MNUCMD file:

MYMAINQQ,1
0001 STRPDM
0002 STRDFU
0003 STRSDA
0004 ? WRKLNK
0005 ? STRREXPRC
0006 CALL *CURLIB/GODB2
0007 STRSQL
0008 STRQM
0009 QSH
0010 GO MAIN
0090 signoff