Home page  Up a level  CL Menu Display File  CL Menu Source  PopMnu Data Area Layout  PopMnu Data Area Edit Program  PopMnu Screen Shots

CL Menu source

/**************************************************************************/
/***        NAME: POPMNU                                                ***/
/*** DESCRIPTION: Initial menu/group job menu.  This is a highly        ***/
/*** configurable menu program that handles up to 64 menu options and   ***/
/*** 16 group jobs.  The menu options can be set/changed on the fly     ***/
/*** without having to compile anything.  The menu options are held in  ***/
/*** the message file POPMNU.  Also, the function keys can be           ***/
/*** configured on the fly.  Multiple menus are available for viewing   ***/
/*** simply by using the page keys - up to ten menus can be defined.    ***/
/***                                                                    ***/
/*** Copyright 1990 by John H. Daily III                                ***/
/**************************************************************************/
/*** Change: added ability to stack commands in menu options - separate ***/
/***         by semi-colon - ";"                                        ***/
/*** Change: added support for multiple menus                           ***/
/*** Change: put all 16 group jobs at the bottom right corner - select  ***/
/***         them by entering or by mouse click - also the group jobs   ***/
/***         are available from any menu                                ***/
/*** Change: allows any option to be a group job                        ***/
/*** Change: select any menu option with mouse click                    ***/
/*** Change: added color to menu options                                ***/
/**************************************************************************/
/*** Objects used by this program:                                      ***/
/***   SIGNON   - data area with length 350 - created if not existing   ***/
/***              this data area is used by PDM programs, not this one  ***/
/***   POPMNU   - data area with attention program to use and various   ***/
/***              variables needed by the program - length 2000         ***/
/***   POPMNU   - message file used to store menu options               ***/
/***   POPMNUDF - display file for the menu program                     ***/
/***   POPATN   - attention program used by other programs to return    ***/
/***              to this one when attention key is pressed - set this  ***/
/***              in the user profile using CHGPRF.                     ***/
/**************************************************************************/
/*** Layout of data area POPMNU:                                        ***/
/***    1 -   10 Date                                                   ***/
/***   11 -   20 Attention program name                                 ***/
/***   21 -   70 Current group job                                      ***/
/***  101 -  110 Display number                                         ***/
/***  171 -  176 Last time used                                         ***/
/***  186 -  188 Wait time before resending display                     ***/
/***  189 -  192 Wait time before locking automatically                 ***/
/***  193 -  200 Lock function keys                                     ***/
/***  201 -  210 Utility library                                        ***/
/***  211 -  212 Hilight hex character                                  ***/
/***  213 -  214 Hilight/Reverse hex character                          ***/
/***  215 -  249 Reserved for later use                                 ***/
/***  250 -  250 Clear commands in STRPDMR1 or not (Y/N)                ***/
/***  251 -  300 Unused                                                 ***/
/***  301 -  301 Show Group Job on edit menu option (Y/N)               ***/
/***  302 -  331 Submenu 0 Menu Title                                   ***/
/***  332 -  361 Submenu 1 Menu Title                                   ***/
/***  362 -  391 Submenu 2 Menu Title                                   ***/
/***  392 -  421 Submenu 3 Menu Title                                   ***/
/***  422 -  451 Submenu 4 Menu Title                                   ***/
/***  452 -  481 Submenu 5 Menu Title                                   ***/
/***  482 -  511 Submenu 6 Menu Title                                   ***/
/***  512 -  541 Submenu 7 Menu Title                                   ***/
/***  542 -  571 Submenu 8 Menu Title                                   ***/
/***  572 -  601 Submenu 9 Menu Title                                   ***/
/***  602 - 2000 Reserved for future expansion                          ***/
/**************************************************************************/
/*** The message file POPMNU:                                           ***/
/*** The menu option is in the first level message text.  The actual    ***/
/*** command that the menu option executes is in the second level text. ***/
/*** The second level text for the group jobs is special and the layout ***/
/*** follows.                                                           ***/
/***                                                                    ***/
/*** Message numbers and what they are used for                         ***/
/*** 0001 - 0080 Menu 1 options                                         ***/
/*** 0081 - 0089 Unused options                                         ***/
/*** 0090        Select menu                                            ***/
/*** 0091        Select screen colors                                   ***/
/*** 0092        Edit function keys                                     ***/
/*** 0093        End all group jobs                                     ***/
/*** 0094        Edit POPMNU data area                                  ***/
/*** 0095        Lock terminal                                          ***/
/*** 0096        Edit menu options                                      ***/
/*** 0097        Change lock password                                   ***/
/*** 0098        Show defined group jobs                                ***/
/*** 0099        Sign off                                               ***/
/*** 0201 - 0210 Commands to be executed first sign on of the day       ***/
/*** 0211 - 0220 Commands are executed each time the program starts     ***/
/*** 0301 - 0324 Function key assignments (future mod)                  ***/
/*** 0401 - 0499 Commands to be executed on a scheduled basis           ***/
/*** 0900        Blank                                                  ***/
/*** 1001 - 1080 Menu 2 menu options                                    ***/
/*** 2001 - 2080 Menu 3 menu options                                    ***/
/*** 3001 - 3080 Menu 4 menu options                                    ***/
/*** 4001 - 4080 Menu 5 menu options                                    ***/
/*** 5001 - 5080 Menu 6 menu options                                    ***/
/*** 6001 - 6080 Menu 7 menu options                                    ***/
/*** 7001 - 7080 Menu 8 menu options                                    ***/
/*** 8001 - 8080 Menu 9 menu options                                    ***/
/*** 9001 - 9080 Menu 10 menu options                                   ***/
/**************************************************************************/
/*** Layout of message for group job:                                   ***/
/***   1 -  10 Group job name                                           ***/
/***  11 -  60 Group job text                                           ***/
/***  61 -  70 Group program name                                       ***/
/***  71 -  74 Group hilight begin                                      ***/
/***  75 -  78 Group hilight end                                        ***/
/**************************************************************************/
/*** Group job default hilight positions                                ***/
/***                                                                    ***/
/*** Job Begin End       Job Begin End                                  ***/
/*** --- ----- ----      --- ----- ----                                 ***/
/*** 01  0001  0003      09  0017  0019                                 ***/
/*** 02  0003  0005      10  0019  0021                                 ***/
/*** 03  0005  0007      11  0021  0023                                 ***/
/*** 04  0007  0009      12  0023  0025                                 ***/
/*** 05  0009  0011      13  0025  0027                                 ***/
/*** 06  0011  0013      14  0027  0029                                 ***/
/*** 07  0013  0015      15  0029  0031                                 ***/
/*** 08  0015  0017      16  0031  0033                                 ***/
/**************************************************************************/
/*** Absolute minimum programs necessary:                               ***/
/***                                                                    ***/
/***            Pop Menu: POPMNU.CLP                                    ***/
/***                      POPMNUC.CLP                                   ***/
/***                      POPATN.CLP                                    ***/
/***                      POPMNU.MSGF                                   ***/
/***                      POPMNU.DTAARA                                 ***/
/***                      POPMNUDF.DSP                                  ***/
/***                      POPLOCK.DTAARA                                ***/
/***                      SIGNON.DTAARA                                 ***/
/***       Retrieve date: RTVDAT.CLP                                    ***/
/***                      RTVDAT.CMD                                    ***/
/*** Calculate Time Diff: CLCTIMDIF.CLP                                 ***/
/***                      CLCTIMDIF.CMD                                 ***/
/**************************************************************************/

PGM

/**************************************************************************/
/*** DECLARE VARIABLES                                                  ***/
/**************************************************************************/

             DCL        VAR(&CLRFLD) TYPE(*CHAR) LEN(1)
             DCL        VAR(&MSGDTA) TYPE(*CHAR) LEN(22)
             DCL        VAR(&DATE7) TYPE(*CHAR) LEN(7)
             DCL        VAR(&DATE6) TYPE(*CHAR) LEN(6)
             DCL        VAR(&DATETEST) TYPE(*CHAR) LEN(10)
             DCL        VAR(&DATETEST1) TYPE(*CHAR) LEN(10)
             DCL        VAR(&HOUR) TYPE(*CHAR) LEN(2)
             DCL        VAR(&MINUTE) TYPE(*CHAR) LEN(2)
             DCL        VAR(&SECOND) TYPE(*CHAR) LEN(2)
             DCL        VAR(&CURLIB) TYPE(*CHAR) LEN(10)
             DCL        VAR(&USER) TYPE(*CHAR) LEN(10)
             DCL        VAR(&PARM1) TYPE(*CHAR) LEN(4) VALUE('*YES')
             DCL        VAR(&RETURNPNT) TYPE(*CHAR)
             DCL        VAR(&JOB) TYPE(*CHAR) LEN(10)
             DCL        VAR(&USRPRF) TYPE(*CHAR) LEN(10)
             DCL        VAR(&ATNPGM) TYPE(*CHAR) LEN(10)
             DCL        VAR(&IN) TYPE(*CHAR) LEN(24)
             DCL        VAR(&RTN) TYPE(*CHAR) LEN(5)
             DCL        VAR(&ONE) TYPE(*CHAR) LEN(2)
             DCL        VAR(&TWO) TYPE(*CHAR) LEN(2)
             DCL        VAR(&THREE) TYPE(*CHAR) LEN(2)
             DCL        VAR(&FOUR) TYPE(*CHAR) LEN(2)
             DCL        VAR(&POS1) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&POPLOCK) TYPE(*CHAR) LEN(1)
             DCL        VAR(&TERMINAL) TYPE(*CHAR) LEN(10)
             DCL        VAR(&SUBSYS) TYPE(*CHAR) LEN(10)
             DCL        VAR(&UTILLIB) TYPE(*CHAR) LEN(10)
             DCL        VAR(&CMD1) TYPE(*CHAR) LEN(1024)
             DCL        VAR(&CMD2) TYPE(*CHAR) LEN(1024)
             DCL        VAR(&CMD3) TYPE(*CHAR) LEN(11)
             DCL        VAR(&CMDBEG) TYPE(*DEC) LEN(3)
             DCL        VAR(&CMDEND) TYPE(*DEC) LEN(3)
             DCL        VAR(&CURMENU) TYPE(*CHAR) LEN(10)
             DCL        VAR(&OLDMENU) TYPE(*CHAR) LEN(10)
             DCL        VAR(&LASTCHANGE) TYPE(*CHAR) LEN(13)
             DCL        VAR(&CURCHANGE) TYPE(*CHAR) LEN(13)
             DCL        VAR(&GROUPJOB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUPJOB#) TYPE(*DEC) LEN(2 0)
             DCL        VAR(&GROUPJOB#1) TYPE(*CHAR) LEN(2)
             DCL        VAR(&SHOWGROUP) TYPE(*CHAR) LEN(1)
             DCL        VAR(&HIPOS) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&SEV) TYPE(*DEC) LEN(2 0)
             DCL        VAR(&GRPLETTER) TYPE(*CHAR) LEN(2)

/***                                                                    ***/
/*** Group job variables.                                               ***/
/***                                                                    ***/

             DCL        VAR(&GRPJOB) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP1) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP2) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP3) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP4) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP5) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP6) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP7) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP8) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP9) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP10) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP11) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP12) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP13) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP14) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP15) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP16) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GRPLIST) TYPE(*CHAR) LEN(1056)
             DCL        VAR(&CURRENT) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GROUP) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GETGROUP) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GRPYES) TYPE(*CHAR) LEN(4)
             DCL        VAR(&COLOR) TYPE(*CHAR) LEN(2)

             DCL        VAR(&NBR1) TYPE(*CHAR) LEN(2)
             DCL        VAR(&NBR2) TYPE(*CHAR) LEN(2)
             DCL        VAR(&NBR3) TYPE(*CHAR) LEN(2)
             DCL        VAR(&NBR4) TYPE(*CHAR) LEN(2)
             DCL        VAR(&NBR5) TYPE(*CHAR) LEN(2)
             DCL        VAR(&SUB) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&HOLDSUB) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&LETTER) TYPE(*CHAR) LEN(2)
             DCL        VAR(&HEADINGLEN) TYPE(*DEC) LEN(3 0) VALUE(58)
             DCL        VAR(&HEADING) TYPE(*CHAR) LEN(58)
             DCL        VAR(&HEADOFFSET) TYPE(*DEC) LEN(3 0)
             DCL        VAR(&HEADSTART) TYPE(*DEC) LEN(1 0)
             DCL        VAR(&GROUPLIST) TYPE(*CHAR) LEN(32)
             DCL        VAR(&GROUPLISTA) TYPE(*CHAR) LEN(16)

/***                                                                    ***/
/*** Highlight variables.                                               ***/
/***                                                                    ***/

             DCL        VAR(&GROUP1L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP2L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP3L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP4L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP5L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP6L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP7L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP8L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP9L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP10L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP11L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP12L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP13L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP14L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP15L) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP16L) TYPE(*CHAR) LEN(1)

/***                                                                    ***/
/*** These variables hold the position before the group job menu option ***/
/*** and the position after the group job menu option for inserting     ***/
/*** hilight, reverse image and normal attributes in the menu.          ***/
/***                                                                    ***/
             DCL        VAR(&GROUP1SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP1S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP1E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP2SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP2S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP2E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP3SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP3S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP3E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP4SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP4S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP4E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP5SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP5S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP5E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP6SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP6S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP6E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP7SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP7S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP7E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP8SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP8S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP8E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP9SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP9S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP9E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP10SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP10S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP10E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP11SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP11S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP11E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP12SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP12S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP12E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP13SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP13S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP13E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP14SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP14S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP14E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP15SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP15S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP15E) TYPE(*DEC) LEN(4 0)

             DCL        VAR(&GROUP16SUB) TYPE(*CHAR) LEN(1)
             DCL        VAR(&GROUP16S) TYPE(*DEC) LEN(4 0)
             DCL        VAR(&GROUP16E) TYPE(*DEC) LEN(4 0)

/***                                                                    ***/
/*** Hilight constants.                                                 ***/
/***                                                                    ***/
             DCL        VAR(&NORM) TYPE(*CHAR) LEN(1) VALUE(X'20')
             DCL        VAR(&HIGH) TYPE(*CHAR) LEN(1) VALUE(X'22')
             DCL        VAR(&HIREV) TYPE(*CHAR) LEN(1) VALUE(X'33')
             DCL        VAR(&SCRNCLR) TYPE(*CHAR) LEN(1)
             DCL        VAR(&SCRNCLR1) TYPE(*CHAR) LEN(2)

/***                                                                    ***/
/*** Password variables.                                                ***/
/***                                                                    ***/
             DCL        VAR(&PW) TYPE(*CHAR) LEN(10) VALUE(TEST)
             DCL        VAR(&LTR) TYPE(*CHAR) LEN(1)
             DCL        VAR(&NEWPW) TYPE(*CHAR) LEN(50)
             DCL        VAR(&DEC) TYPE(*DEC) LEN(2 0)
             DCL        VAR(&DEC3) TYPE(*DEC) LEN(3 0)
             DCL        VAR(&HEX) TYPE(*CHAR) LEN(128)
             DCL        VAR(&LEN) TYPE(*DEC) LEN(5 0) VALUE(1)
             DCL        VAR(&HEXR) TYPE(*CHAR) LEN(256)
             DCL        VAR(&POS) TYPE(*DEC) LEN(3 0)
             DCL        VAR(&LTRD) TYPE(*DEC) LEN(5 0)
             DCL        VAR(&LTR2) TYPE(*CHAR) LEN(2)
             DCL        VAR(&LTR3) TYPE(*CHAR) LEN(3)
             DCL        VAR(&SUB1) TYPE(*DEC) LEN(3 0)

/***                                                                    ***/
/*** New menu loading variables.                                        ***/
/***                                                                    ***/

             DCL        VAR(&MSG) TYPE(*CHAR) LEN(80)
             DCL        VAR(&MSG#) TYPE(*DEC) LEN(3 0)
             DCL        VAR(&MSGC) TYPE(*CHAR) LEN(3)
             DCL        VAR(&MSGID) TYPE(*CHAR) LEN(7)
             DCL        VAR(&FIELD) TYPE(*CHAR) LEN(19)
             DCL        VAR(&SECLVL) TYPE(*CHAR) LEN(78)
             DCL        VAR(&DEFAULT) TYPE(*CHAR) LEN(200)
             DCL        VAR(&SUBMENU) TYPE(*CHAR) LEN(1)
             DCL        VAR(&SUBMENUN) TYPE(*DEC) LEN(1)

             DCL        VAR(&COMMAND) TYPE(*CHAR) LEN(1024)
             DCL        VAR(&CMDLEN) TYPE(*DEC) LEN(15 5)
             DCL        VAR(&TEXT1) TYPE(*CHAR) LEN(20)
             DCL        VAR(&TEXT2) TYPE(*CHAR) LEN(1024)
             DCL        VAR(&TEXT3) TYPE(*CHAR) LEN(1024)
             DCL        VAR(&PASSWORD) TYPE(*CHAR) LEN(10)
             DCL        VAR(&GRPTEXT) TYPE(*CHAR) LEN(70)
             DCL        VAR(&TEXT) TYPE(*CHAR) LEN(50)
             DCL        VAR(&GRPPGM) TYPE(*CHAR) LEN(10)

/***                                                                    ***/
/*** QCLSCAN variables.                                                 ***/
/***                                                                    ***/

             DCL        VAR(&STRING) TYPE(*CHAR) LEN(999)
             DCL        VAR(&STRLEN) TYPE(*DEC) LEN(3 0)
             DCL        VAR(&STRPOS) TYPE(*DEC) LEN(3 0)
             DCL        VAR(&PATTERN) TYPE(*CHAR) LEN(1)
             DCL        VAR(&PATLEN) TYPE(*DEC) LEN(3 0)
             DCL        VAR(&TRANSLATE) TYPE(*CHAR) LEN(1)
             DCL        VAR(&TRIM) TYPE(*CHAR) LEN(1)
             DCL        VAR(&WILD) TYPE(*CHAR) LEN(1)
             DCL        VAR(&RESULT) TYPE(*DEC) LEN(3 0)
             DCL        VAR(&LENGTH) TYPE(*DEC) LEN(3 0)

/***                                                                    ***/
/*** Elapsed time variables.                                            ***/
/***                                                                    ***/

             DCL        VAR(&GETTIME) TYPE(*CHAR) LEN(6)
             DCL        VAR(&HOLDTIME) TYPE(*CHAR) LEN(6)
             DCL        VAR(&HOLDTIME1) TYPE(*CHAR) LEN(6)
             DCL        VAR(&ELAPSED) TYPE(*CHAR) LEN(5)
             DCL        VAR(&ELAPSED1) TYPE(*DEC) LEN(5 0)
             DCL        VAR(&LOCKTIME1) TYPE(*CHAR) LEN(4)
             DCL        VAR(&LOCKTIME) TYPE(*DEC) LEN(5 0)
             DCL        VAR(&WAITTIME1) TYPE(*CHAR) LEN(3)
             DCL        VAR(&WAITTIME) TYPE(*DEC) LEN(3 0)

/***                                                                    ***/
             DCL        VAR(&DISPLAYF) TYPE(*CHAR) LEN(10) +
                          VALUE(POPMNUDF)

/***                                                                    ***/
/*** Function key editing variables.                                    ***/
/***                                                                    ***/
             DCL        VAR(&FKEY) TYPE(*CHAR) LEN(3)
             DCL        VAR(&FCMD) TYPE(*CHAR) LEN(1024)

/***                                                                    ***/
/*** The display file.                                                  ***/
/***                                                                    ***/
             DCLF       FILE(POPMNUDF)


/**************************************************************************/
/*** PROGRAM WIDE MONITOR MESSAGES                                      ***/
/**************************************************************************/

             MONMSG     MSGID(CPF6801)
             MONMSG     MSGID(CPF0006)
             MONMSG     MSGID(CPF2103)
             MONMSG     MSGID(CPF2451)
             MONMSG     MSGID(MCH0603) EXEC(GOTO CMDLBL(ENDSECURE))
             MONMSG     MSGID(CPF2499)
             MONMSG     MSGID(CPF0887)

             MONMSG     MSGID(CPF0818)
             MONMSG     MSGID(CPF2450)


/**************************************************************************/

/***                                                                    ***/
/*** Set up the values for the colors.                                  ***/
/***                                                                    ***/
CHGVAR &FLD0001 VALUE(X'21')
CHGVAR &FLD0001 VALUE(&FLD0001 *TCAT '21')
CHGVAR &S17COLOR01 &FLD0001

CHGVAR &FLD0002 VALUE(X'22')
CHGVAR &FLD0002 VALUE(&FLD0002 *TCAT '22')
CHGVAR &S17COLOR02 &FLD0002

CHGVAR &FLD0003 VALUE(X'23')
CHGVAR &FLD0003 VALUE(&FLD0003 *TCAT '23')
CHGVAR &S17COLOR03 &FLD0003

CHGVAR &FLD0004 VALUE(X'24')
CHGVAR &FLD0004 VALUE(&FLD0004 *TCAT '24')
CHGVAR &S17COLOR04 &FLD0004

CHGVAR &FLD0005 VALUE(X'25')
CHGVAR &FLD0005 VALUE(&FLD0005 *TCAT '25')
CHGVAR &S17COLOR05 &FLD0005

CHGVAR &FLD0006 VALUE(X'26')
CHGVAR &FLD0006 VALUE(&FLD0006 *TCAT '26')
CHGVAR &S17COLOR06 &FLD0006

CHGVAR &FLD0007 VALUE(X'27')
CHGVAR &FLD0007 VALUE(&FLD0007 *TCAT '27')

CHGVAR &FLD0008 VALUE(X'28')
CHGVAR &FLD0008 VALUE(&FLD0008 *TCAT '28')
CHGVAR &S17COLOR07 &FLD0008

CHGVAR &FLD0009 VALUE(X'29')
CHGVAR &FLD0009 VALUE(&FLD0009 *TCAT '29')
CHGVAR &S17COLOR08 &FLD0009

CHGVAR &FLD0010 VALUE(X'2A')
CHGVAR &FLD0010 VALUE(&FLD0010 *TCAT '2A')

CHGVAR &FLD0011  VALUE(X'2B')
CHGVAR &FLD0011  VALUE(&FLD0011 *TCAT '2B')

CHGVAR &FLD0012  VALUE(X'2C')
CHGVAR &FLD0012  VALUE(&FLD0012 *TCAT '2C')
CHGVAR &S17COLOR09 &FLD0012

CHGVAR &FLD0013  VALUE(X'2D')
CHGVAR &FLD0013  VALUE(&FLD0013 *TCAT '2D')
CHGVAR &S17COLOR10 &FLD0013

CHGVAR &FLD0014  VALUE(X'2E')
CHGVAR &FLD0014  VALUE(&FLD0014  *TCAT '2E')

CHGVAR &FLD0015  VALUE(X'2F')
CHGVAR &FLD0015  VALUE(&FLD0015  *TCAT '2F')

CHGVAR &FLD0016  VALUE(X'30')
CHGVAR &FLD0016  VALUE(&FLD0016  *TCAT '30')
CHGVAR &S17COLOR11 &FLD0016

CHGVAR &FLD0017  VALUE(X'31')
CHGVAR &FLD0017  VALUE(&FLD0017  *TCAT '31')
CHGVAR &S17COLOR12 &FLD0017

CHGVAR &FLD0018  VALUE(X'32')
CHGVAR &FLD0018  VALUE(&FLD0018  *TCAT '32')
CHGVAR &S17COLOR13 &FLD0018

CHGVAR &FLD0019  VALUE(X'33')
CHGVAR &FLD0019  VALUE(&FLD0019  *TCAT '33')
CHGVAR &S17COLOR14 &FLD0019

CHGVAR &FLD0020  VALUE(X'34')
CHGVAR &FLD0020  VALUE(&FLD0020  *TCAT '34')
CHGVAR &S17COLOR15 &FLD0020

CHGVAR &FLD0021  VALUE(X'35')
CHGVAR &FLD0021  VALUE(&FLD0021  *TCAT '35')
CHGVAR &S17COLOR16 &FLD0021

CHGVAR &FLD0022  VALUE(X'36')
CHGVAR &FLD0022  VALUE(&FLD0022  *TCAT '36')
CHGVAR &S17COLOR17 &FLD0022

CHGVAR &FLD0023  VALUE(X'37')
CHGVAR &FLD0023  VALUE(&FLD0023  *TCAT '37')

CHGVAR &FLD0024  VALUE(X'38')
CHGVAR &FLD0024  VALUE(&FLD0024  *TCAT '38')
CHGVAR &S17COLOR18 &FLD0024

CHGVAR &FLD0025  VALUE(X'39')
CHGVAR &FLD0025  VALUE(&FLD0025  *TCAT '39')
CHGVAR &S17COLOR19 &FLD0025

CHGVAR &FLD0026  VALUE(X'3A')
CHGVAR &FLD0026  VALUE(&FLD0026  *TCAT '3A')
CHGVAR &S17COLOR20 &FLD0026

CHGVAR &FLD0027  VALUE(X'3B')
CHGVAR &FLD0027  VALUE(&FLD0027  *TCAT '3B')
CHGVAR &S17COLOR21 &FLD0027

CHGVAR &FLD0028  VALUE(X'3C')
CHGVAR &FLD0028  VALUE(&FLD0028  *TCAT '3C')
CHGVAR &S17COLOR22 &FLD0028

CHGVAR &FLD0029  VALUE(X'3D')
CHGVAR &FLD0029  VALUE(&FLD0029  *TCAT '3D')
CHGVAR &S17COLOR23 &FLD0029

CHGVAR &FLD0030  VALUE(X'3E')
CHGVAR &FLD0030  VALUE(&FLD0030  *TCAT '3E')
CHGVAR &S17COLOR24 &FLD0030


/**************************************************************************/
/*** INITIAL PROGRAM SETUP                                              ***/
/**************************************************************************/
             CHGVAR     VAR(&SUBMENU) VALUE('0')
             RTVDTAARA  DTAARA(POPMNU (201 10)) RTNVAR(&UTILLIB)
             RTVDTAARA  DTAARA(POPMNU (191 2)) RTNVAR(&SCRNCLR1)
             CHGVAR     VAR(&S1GROUPS) VALUE(' A B C D E F G H I J K +
                          L M N O P')
             CHGVAR     VAR(&GROUPLIST) +
                          VALUE('81828384858687888990919293949596')
             CHGVAR     VAR(&GROUPLISTA) VALUE('ABCDEFGHIJKLMNOP')

/***                                                                    ***/
/*** Create the message queue.                                          ***/
/***                                                                    ***/
             CRTMSGQ    MSGQ(QTEMP/Q)
             MONMSG     MSGID(CPF0000)

             CHGMSGQ    MSGQ(QTEMP/Q) DLVRY(*BREAK) PGM(&UTILLIB/EXCMD)
             MONMSG     MSGID(CPF0000)

/***                                                                    ***/
/*** See if program should be locked on entry.                          ***/
/***                                                                    ***/

             RTVDTAARA  DTAARA(POPLOCK) RTNVAR(&POPLOCK)
             IF         COND(&POPLOCK *EQ 'Y') THEN(DO)
                CHGVAR     VAR(&PARM1) VALUE('*NO')
             ENDDO

/***                                                                    ***/
/*** Check for the POPMNU data area; create and populate it if it does  ***/
/*** not exist.                                                         ***/
/***                                                                    ***/
             CHKOBJ     OBJ(POPMNU) OBJTYPE(*DTAARA)
             MONMSG     MSGID(CPF0000) EXEC(DO)
                CRTDTAARA  DTAARA(*CURLIB/POPMNU) TYPE(*CHAR) +
                             LEN(210) VALUE('01011998   POPATN')
                CHGDTAARA  DTAARA(POPMNU (186 2)) VALUE('15') /*�+
�                            Display file refresh time in seconds�*/
                CHGDTAARA  DTAARA(POPMNU (189 4)) VALUE('1500') /*�+
�                            Lock display time in minutes:seconds�*/
             ENDDO

/***                                                                    ***/
/*** Retrieve the current program library and the attention program.    ***/
/***                                                                    ***/
             RTVJOBA    JOB(&JOB) USER(&USRPRF) CURLIB(&CURLIB)
             RTVDTAARA  DTAARA(POPMNU (11 10)) RTNVAR(&ATNPGM)

/***                                                                    ***/
/*** Check for the SIGNON data area; create it if it does not exist.    ***/
/***                                                                    ***/
             CHKOBJ     OBJ(SIGNON) OBJTYPE(*DTAARA)
             MONMSG     MSGID(CPF0000) EXEC(CRTDTAARA +
                          DTAARA(*CURLIB/SIGNON) TYPE(*CHAR) LEN(350))

/***                                                                    ***/
/*** Check for the message file and create it and the messages if it is ***/
/*** not found.                                                         ***/
/***                                                                    ***/
             CHKOBJ     OBJ(POPMNU) OBJTYPE(*MSGF)
             MONMSG     MSGID(CPF0000) EXEC(DO)
                CRTMSGF    MSGF(POPMNU) /*�Create the message file�*/
                CHGVAR     VAR(&DEC) VALUE(0)

/***                                                                    ***/
/*** Add the menu display messages to the message file.  Populate some  ***/
/*** of the messages with the most frequently used commands.            ***/
/***                                                                    ***/
AddMsgs:
                CHGVAR     VAR(&DEC) VALUE(&DEC + 1)
                MONMSG     MSGID(MCH1210) EXEC(GOTO CMDLBL(ENDADD))
                IF         COND(&DEC *EQ 0) THEN(GOTO CMDLBL(ENDADD))
                CHGVAR     VAR(&LTR2) VALUE(&DEC)
                CHGVAR     VAR(&MSGID) VALUE('MNU00' *CAT &LTR2)
                IF         COND(%SST(&LTR2 1 1) *EQ '0') THEN( +
                             CHGVAR VAR(%SST(&LTR2 1 1)) VALUE(' '))
                CHGVAR     VAR(&SECLVL) VALUE(' ')
                CHGVAR     VAR(&MSG) VALUE(&LTR2 *CAT '.')
                IF         COND(&DEC *EQ 1) THEN(DO)
                     CHGVAR     VAR(&MSG) VALUE(' 1. Active Jobs')
                     CHGVAR     VAR(&SECLVL) VALUE('WRKACTJOB')
                ENDDO
                IF         COND(&DEC *EQ 2) THEN(DO)
                     CHGVAR     VAR(&MSG) VALUE(' 2. Spooled Files')
                     CHGVAR     VAR(&SECLVL) VALUE('WRKSPLF')
                ENDDO
                IF         COND(&DEC *EQ 3) THEN(DO)
                     CHGVAR     VAR(&MSG) VALUE(' 3. Device Status')
                     CHGVAR     VAR(&SECLVL) +
                                  VALUE('WRKCFGSTS CFGTYPE(*DEV)')
                ENDDO
                IF         COND(&DEC *EQ 4) THEN(DO)
                     CHGVAR     VAR(&MSG) VALUE(' 4. Controller Sts')
                     CHGVAR     VAR(&SECLVL) +
                                  VALUE('WRKCFGSTS CFGTYPE(*CTL)')
                ENDDO
                IF         COND(&DEC *EQ 5) THEN(DO)
                     CHGVAR     VAR(&MSG) VALUE(' 5. Line Status')
                     CHGVAR     VAR(&SECLVL) +
                                  VALUE('WRKCFGSTS CFGTYPE(*LIN)')
                ENDDO
                IF         COND(&DEC *EQ 12) THEN(DO)
                     CHGVAR     VAR(&MSG) VALUE('12. Who')
                     CHGVAR     VAR(&SECLVL) VALUE('WHO')
                ENDDO
                IF         COND(&DEC *EQ 13) THEN(DO)
                     CHGVAR     VAR(&MSG) VALUE('13. Disp Messages')
                     CHGVAR     VAR(&SECLVL) VALUE('DSPMSG')
                ENDDO
                IF         COND(&DEC *EQ 18) THEN(DO)
                     CHGVAR     VAR(&MSG) VALUE('18. Work W/Members')
                     CHGVAR     VAR(&SECLVL) VALUE(+
                                  'CALL PGM(STRPDM) PARM(M)')
                ENDDO
                IF         COND(&DEC *EQ 19) THEN(DO)
                     CHGVAR     VAR(&MSG) VALUE('19. Work W/Objects')
                     CHGVAR     VAR(&SECLVL) VALUE(+
                                  'CALL PGM(STRPDM) PARM(O)')
                ENDDO
                IF         COND(&DEC *EQ 20) THEN(DO)
                     CHGVAR     VAR(&MSG) VALUE('20. Work W/Libs')
                     CHGVAR     VAR(&SECLVL) VALUE(+
                                  'CALL PGM(STRPDM) PARM(L)')
                ENDDO

/***                                                                    ***/
/*** Add the message and go back to the start.                          ***/
/***                                                                    ***/
                ADDMSGD    MSGID(&MSGID) MSGF(POPMNU) +
                             MSG(&MSG) SECLVL(&SECLVL)
                GOTO       CMDLBL(ADDMSGS)

/***                                                                    ***/
/*** These are the group job menu options.  Populate them with the      ***/
/*** group job names and the beginning and ending positions for         ***/
/*** hilighting.                                                        ***/
/***                                                                    ***/
/*** Not used anymore.                                                  ***/
/***                                                                    ***/
                IF         COND(&DEC *EQ 65) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP1')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('03780400')
                ENDDO
                IF         COND(&DEC *EQ 66) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP2')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('04580480')
                ENDDO
                IF         COND(&DEC *EQ 67) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP3')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('05380560')
                ENDDO
                IF         COND(&DEC *EQ 68) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP4')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('06180640')
                ENDDO
                IF         COND(&DEC *EQ 69) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP5')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('06980720')
                ENDDO
                IF         COND(&DEC *EQ 70) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP6')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('07780800')
                ENDDO
                IF         COND(&DEC *EQ 71) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP7')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('08580880')
                ENDDO
                IF         COND(&DEC *EQ 72) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP8')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('09380960')
                ENDDO
                IF         COND(&DEC *EQ 73) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP9')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('10181040')
                ENDDO
                IF         COND(&DEC *EQ 74) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP10')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('10981120')
                ENDDO
                IF         COND(&DEC *EQ 75) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP11')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('11781200')
                ENDDO
                IF         COND(&DEC *EQ 76) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP12')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('12581280')
                ENDDO
                IF         COND(&DEC *EQ 77) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP13')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('13381360')
                ENDDO
                IF         COND(&DEC *EQ 78) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP14')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('14181440')
                ENDDO
                IF         COND(&DEC *EQ 79) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP15')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('14981520')
                ENDDO
                IF         COND(&DEC *EQ 80) THEN(DO)
                     CHGVAR VAR(%SST(&SECLVL 1 6)) VALUE('GROUP16')
                     CHGVAR VAR(%SST(&SECLVL 71 8)) VALUE('15781600')
                ENDDO
EndAdd:
/***                                                                    ***/
/*** Add the group job options 9981-9996.                               ***/
/***                                                                    ***/
             CHGVAR     VAR(&dec) VALUE(80)
AddGroup:
             CHGVAR     VAR(&DEC) VALUE(&DEC + 1)
             IF         COND(&DEC *GT 96) THEN(GOTO CMDLBL(NEXT200))
             CHGVAR     VAR(&LTR2) VALUE(&DEC)
             CHGVAR     VAR(&MSGID) VALUE('MNU99' *BCAT &LTR2)
             CHGVAR     VAR(&MSG) VALUE('Programming')

             CHGVAR     VAR(&SUB) VALUE(&DEC - 80)
             CHGVAR     VAR(&LTR2) VALUE(&SUB)
             CHGVAR     VAR(&SECLVL) VALUE('GROUP' *TCAT &LTR2)
             CHGVAR     VAR(%SST(&SECLVL 11 20)) VALUE('Programming')
             CHGVAR     VAR(%SST(&SECLVL 61 7)) VALUE(STRPDMN)
             CHGVAR     VAR(&SUB) VALUE(&SUB * 2)
             CHGVAR     VAR(&SUB) VALUE(&SUB - 1)
             CHGVAR     VAR(&LTR2) VALUE(&SUB)
             CHGVAR     VAR(%SST(&SECLVL 71 4)) VALUE('00' *CAT LTR2)
             CHGVAR     VAR(&SUB) VALUE(&SUB + 2)
             CHGVAR     VAR(&LTR2) VALUE(&SUB)
             CHGVAR     VAR(%SST(&SECLVL 75 4)) VALUE('00' *CAT LTR2)

             ADDMSGD    MSGID(&MSGID) MSGF(POPMNU) MSG(&MSG) +
                          SECLVL(&SECLVL)
             GOTO       CMDLBL(ADDGROUP)

/***                                                                    ***/
/*** Add the executable messages to the message file.  Messages 201-    ***/
/*** 210 are executed the first signon of the day.  Messages 211-220    ***/
/*** are executed every time the program starts.                        ***/
/***                                                                    ***/
Next200:
                CHGVAR     VAR(&DEC3) VALUE(200)
Add200:
                CHGVAR     VAR(&DEC3) VALUE(&DEC3 + 1)
                IF         COND(&DEC3 *GT 220) +
                             THEN(GOTO CMDLBL(END200))
                CHGVAR     VAR(&LTR3) VALUE(&DEC3)
                CHGVAR     VAR(&MSGID) VALUE('MNU0' *CAT &LTR3)
                IF         COND(%SST(&LTR3 1 2) *EQ '00') THEN( +
                             CHGVAR VAR(%SST(&LTR3 1 2)) VALUE('  '))
                IF         COND(%SST(&LTR3 1 1) *EQ '0') THEN( +
                             CHGVAR VAR(%SST(&LTR3 1 1)) VALUE(' '))
                CHGVAR     VAR(&SECLVL) VALUE(' ')
                CHGVAR     VAR(&MSG) VALUE(&LTR3 *CAT '.')
                ADDMSGD    MSGID(&MSGID) MSGF(POPMNU) MSG(&MSG) +
                             SECLVL(&SECLVL)
                GOTO       CMDLBL(ADD200)
End200:

/***                                                                    ***/
/*** Add the function key messages to the message file.                 ***/
/***                                                                    ***/
                CHGVAR     VAR(&DEC3) VALUE(300)
Add300:
                CHGVAR     VAR(&DEC3) VALUE(&DEC3 + 1)
                IF         COND(&DEC3 *GT 324) +
                             THEN(GOTO CMDLBL(END300))
                CHGVAR     VAR(&LTR3) VALUE(&DEC3)
                CHGVAR     VAR(&MSGID) VALUE('MNU0' *CAT &LTR3)
                IF         COND(%SST(&LTR3 1 2) *EQ '00') THEN( +
                             CHGVAR VAR(%SST(&LTR3 1 2)) VALUE('  '))
                IF         COND(%SST(&LTR3 1 1) *EQ '0') THEN( +
                             CHGVAR VAR(%SST(&LTR3 1 1)) VALUE(' '))
                CHGVAR     VAR(&SECLVL) VALUE(' ')
                CHGVAR     VAR(&MSG) VALUE(&LTR3 *CAT '.')
                ADDMSGD    MSGID(&MSGID) MSGF(POPMNU) MSG(&MSG) +
                             SECLVL(&SECLVL)
                GOTO       CMDLBL(ADD300)
End300:
                ADDMSGD    MSGID(MNU0900) MSGF(POPMNU) MSG(' ') +
                             SECLVL(' ')
             ENDDO


/**************************************************************************/
/***                         HOUSEKEEPING                               ***/
/**************************************************************************/
             GOTO       CMDLBL(HOUSE_KEEP)
End_HouseK:


/**************************************************************************/
/*** Load the menu options from the message variables.                  ***/
/**************************************************************************/
             GOTO       CMDLBL(LOAD_SCREN)
End_Load:


/**************************************************************************/
/*** Lock terminal.                                                     ***/
/**************************************************************************/
/***                                                                    ***/
/*** Do we skip locking the display?                                    ***/
/***                                                                    ***/
             CHGVAR     VAR(&RETURNPNT) VALUE(DISPLAY)
             IF         COND(&PARM1 *EQ '*NO') THEN(GOTO +
                          CMDLBL(SECURE1))


/**************************************************************************/
/*** Main program - display the menu and handle the menu options.       ***/
/**************************************************************************/
Display:
             CHGVAR     VAR(&GETGROUP) VALUE(RET_DSPLY)
             GOTO       CMDLBL(GETGRPLIST)
Ret_Dsply:

/***                                                                    ***/
/*** Set up the screen fields.                                          ***/
/***                                                                    ***/

             RTVJOBA    CURLIB(&CURLIB)
             CHGVAR     VAR(&S1CURLIB) VALUE(&CURLIB)

             RTVSYSVAL  SYSVAL(QDATE) RTNVAR(&DATE6)
             RTVDAT     CYYMMDD(&DATE7)
             CVTDAT     DATE(&DATE6) TOVAR(&DATETEST) +
                          FROMFMT(*MDY) TOFMT(*MDYY) TOSEP(/)
             CHGVAR     VAR(&S1DATE) VALUE(&DATETEST)

             CHGVAR     VAR(&SINP) VALUE('  ')
Sndf:
/***                                                                    ***/
/*** Get the date/time that the message file was changed.               ***/
/***                                                                    ***/
             RTVOBJD    OBJ(POPMNU) OBJTYPE(*MSGF) CHGDATE(&CURCHANGE)
             IF         COND(&CURCHANGE *NE &LASTCHANGE *AND +
                          &LASTCHANGE *NE ' ') THEN(DO)
                IF         COND(&CURMENU = &OLDMENU) THEN(DO)
                   CHGVAR     VAR(&RETURNPNT) VALUE('REFRSHDONE')
                   GOTO       CMDLBL(RESTART)
                ENDDO
                ELSE       CMD(CHGVAR VAR(&OLDMENU) VALUE(&CURMENU))
RefrshDone:
             ENDDO

             CHGVAR     VAR(&LASTCHANGE) VALUE(&CURCHANGE)
             CHGVAR     VAR(&CURCHANGE) VALUE(' ')

/***                                                                    ***/
/*** Get the time and display the file.                                 ***/
/***                                                                    ***/

             RTVSYSVAL  SYSVAL(QHOUR) RTNVAR(&HOUR)
             RTVSYSVAL  SYSVAL(QMINUTE) RTNVAR(&MINUTE)
             RTVSYSVAL  SYSVAL(QSECOND) RTNVAR(&SECOND)
             CHGVAR     VAR(&S1TIME) VALUE(&HOUR *CAT ':' *CAT +
                          &MINUTE *CAT ':' *CAT &SECOND)

             RTVJOBA    CURLIB(&CURLIB)
             CHGVAR     VAR(&S1CURLIB) VALUE(&CURLIB)

             SNDRCVF    RCDFMT(SCRN01) WAIT(*NO)
             WAIT
/***                                                                    ***/
/*** Monitor for a timeout on the display.                              ***/
/***                                                                    ***/
             MONMSG     MSGID(CPF0889) EXEC(DO)
                RCVMSG     PGMQ(*SAME (*)) MSGQ(*PGMQ) MSGTYPE(*EXCP)
                RTVDTAARA  DTAARA(POPLOCK) RTNVAR(&POPLOCK)
                IF         COND(&POPLOCK *EQ 'Y') THEN(GOTO +
                             CMDLBL(SECURE1))
                ELSE       CMD(DO)
/***                                                                    ***/
/*** Get the current time, check against the elapsed time.  If the      ***/
/*** LOCKTIME has passed, automatically lock the display.               ***/
/***                                                                    ***/
                   RTVSYSVAL  SYSVAL(QTIME) RTNVAR(&GETTIME)
                   CHGVAR     VAR(&HOLDTIME1) VALUE(&GETTIME)
                   RTVDTAARA  DTAARA(POPMNU (171 6)) +
                                RTNVAR(&HOLDTIME)
                   CLCTIMDIF  FROMTIME(&HOLDTIME) +
                                TOTIME(&HOLDTIME1) +
                                SECONDS(&ELAPSED)
                   CHGVAR     VAR(&ELAPSED1) VALUE(&ELAPSED)
                   IF         COND(&ELAPSED1 *GE &LOCKTIME) +
                                THEN(GOTO CMDLBL(SECURE1))
                   ELSE       CMD(DO)
                      CHGDTAARA  DTAARA(POPMNU (171 6)) VALUE(&HOLDTIME)
                      GOTO       CMDLBL(SNDF)
                   ENDDO
                ENDDO
             ENDDO

/***                                                                    ***/
/*** General monitor messages.                                          ***/
/***                                                                    ***/
             MONMSG     MSGID(CPF0887 CPF5192 CPF5193 CPF2320 +
                          CPF0000) EXEC(GOTO CMDLBL(SNDF))

/***                                                                    ***/
/*** Get the current time.                                              ***/
/***                                                                    ***/
             RTVSYSVAL  SYSVAL(QTIME) RTNVAR(&GETTIME)
             CHGVAR     VAR(&HOLDTIME) VALUE(&GETTIME)

/**************************************************************************/

/***                                                                    ***/
/*** Handle group jobs.                                                 ***/
/***                                                                    ***/
             IF         COND((&IN24 *AND &S1RTNCOL > 48 *AND +
                          &S1RTNROW = 24) *OR (&SINP *GE 'A' *AND +
                          &SINP *LE 'P')) THEN(DO)
               CHGVAR     VAR(&POS) VALUE(&S1RTNCOL - 47)
               CHGVAR     VAR(&POS) VALUE(&POS - 1)

/***                                                                    ***/
/*** If the letter was entered instead of moused, get the position of   ***/
/*** the option in the array.                                           ***/
/***                                                                    ***/
               IF         COND(&POS *LT 1) THEN(DO)
                 CHGVAR     VAR(&STRING) VALUE(&GROUPLISTA)
                 CHGVAR     VAR(&RESULT) VALUE(0)
                 CHGVAR     VAR(&STRLEN) VALUE(16)
                 CHGVAR     VAR(&PATTERN) VALUE(&SINP)
                 CHGVAR     VAR(&PATLEN) VALUE(1)
                 CHGVAR     VAR(&STRPOS) VALUE(1)
                 CHGVAR     VAR(&RESULT) VALUE(0)

                 CALL       PGM(QCLSCAN) PARM(&STRING &STRLEN &STRPOS +
                              &PATTERN &PATLEN &TRANSLATE &TRIM &WILD +
                              &RESULT)
                 CHGVAR     VAR(&POS) VALUE((&RESULT * 2) - 1)
               ENDDO

/***                                                                    ***/
/*** Using the array, create the message ID and retrieve it.            ***/
/***                                                                    ***/
               CHGVAR     VAR(&GRPLETTER) VALUE(%SST(&GROUPLIST +
                            &POS 2))
               CHGVAR     VAR(&MSGID) VALUE('MNU99' *TCAT &GRPLETTER)
               RTVMSG     MSGID(&MSGID) MSGF(POPMNU) SECLVL(&GRPTEXT) +
                            LOGPRB(&GROUPJOB)
               MONMSG     MSGID(CPF0001) EXEC(DO)
                 CHGVAR     VAR(&SINP) VALUE('  ')
                 GOTO       CMDLBL(DISPLAY)
               ENDDO

/***                                                                    ***/
/*** Set the group options from the message text.                       ***/
/***                                                                    ***/
               CHGVAR     VAR(&GROUP) VALUE(%SST(&GRPTEXT 1 10))
               CHGVAR     VAR(&TEXT) VALUE(%SST(&GRPTEXT 11 50))
               CHGVAR     VAR(&GRPPGM) VALUE(%SST(&GRPTEXT 61 10))

/***                                                                    ***/
/*** If there is no group program defined for this option then skip it. ***/
/***                                                                    ***/
               IF         COND(&GRPPGM *EQ ' ') THEN(GOTO +
                            CMDLBL(DISPLAY))

/***                                                                    ***/
/*** Otherwise, change to that group.                                   ***/
/***                                                                    ***/
               IF         COND(&GRPJOB *EQ &GROUP) THEN(RETURN)
               ELSE       CMD(DO)
                 IF         COND(&LETTER *EQ &NBR1) +
                              THEN(CHGDTAARA DTAARA(POPMNU +
                              (21 10)) VALUE(&GROUP))
                 ELSE       CMD(IF COND(&LETTER *EQ &NBR2) +
                              THEN(CHGDTAARA DTAARA(POPMNU +
                              (31 10)) VALUE(&GROUP)))
                 ELSE       CMD(IF COND(&LETTER *EQ &NBR3) +
                              THEN(CHGDTAARA DTAARA(POPMNU +
                              (41 10)) VALUE(&GROUP)))
                 ELSE       CMD(IF COND(&LETTER *EQ &NBR4) +
                              THEN(CHGDTAARA DTAARA(POPMNU +
                              (51 10)) VALUE(&GROUP)))
                 ELSE       CMD(IF COND(&LETTER *EQ &NBR5) +
                              THEN(CHGDTAARA DTAARA(POPMNU +
                              (61 10)) VALUE(&GROUP)))

                 IF (&GROUP *NE ' ') +
                 TFRGRPJOB  GRPJOB(&GROUP) INLGRPPGM(&GRPPGM) +
                              TEXT(&TEXT)

                 CHGVAR     VAR(&GETGROUP) VALUE(GROUPJOBX)
                 IF         COND(&GRPJOB *NE ' ' *AND &GRPJOB +
                              *NE 'SIGNON') THEN(RETURN)
                ENDDO

                CHGVAR     VAR(&IN24) VALUE('0')
                CHGVAR     VAR(&SINP) VALUE('  ')
                GOTO       CMDLBL(DISPLAY)
             ENDDO

/**************************************************************************/
             ELSE       CMD(IF COND(&IN24) THEN(DO))
                IF         COND(&S1RTNCOL *GE 1 *AND &S1RTNCOL *LE +
                             20) THEN(DO)
                   CHGVAR     VAR(&S1RTNROW) VALUE(&S1RTNROW - 2)
                   CHGVAR     VAR(&SINP) VALUE(&S1RTNROW)

                ENDDO

                ELSE       CMD(IF COND(&S1RTNCOL *GE 21 *AND +
                             &S1RTNCOL *LE 39) THEN(DO))
                   CHGVAR    VAR(&S1RTNROW) VALUE((&S1RTNROW - 2) +20)
                   CHGVAR     VAR(&SINP) VALUE(&S1RTNROW)
                ENDDO

                ELSE       CMD(IF COND(&S1RTNCOL *GE 40 *AND +
                             &S1RTNCOL *LE 58) THEN(DO))
                   CHGVAR    VAR(&S1RTNROW) VALUE((&S1RTNROW - 2) +40)
                   CHGVAR     VAR(&SINP) VALUE(&S1RTNROW)
                ENDDO

                ELSE       CMD(IF COND(&S1RTNCOL *GE 59 *AND +
                             &S1RTNCOL *LE 80) THEN(DO))
                   CHGVAR    VAR(&S1RTNROW) VALUE((&S1RTNROW - 2) +60)
                   CHGVAR     VAR(&SINP) VALUE(&S1RTNROW)
                ENDDO
                CHGVAR     VAR(&IN24) VALUE('0')
             ENDDO

/**************************************************************************/

/***                                                                    ***/
/*** Handle the function keys.                                          ***/
/***                                                                    ***/
             CHGVAR     VAR(&RTN) VALUE(FKEYS)
             GOTO       CMDLBL(GETPFK)
FKEYS:
             /*** Change &STRING to have the function key values.       ***/
             CHGVAR     VAR(&STRING) VALUE(&IN)
             CHGVAR     VAR(&RESULT) VALUE(0)
             CHGVAR     VAR(&STRLEN) VALUE(24)
             CHGVAR     VAR(&PATTERN) VALUE('1')
             CHGVAR     VAR(&PATLEN) VALUE(1)
             CHGVAR     VAR(&STRPOS) VALUE(1)
             CHGVAR     VAR(&RESULT) VALUE(0)

             /*** Search for a '1' in the array.                        ***/
             CALL       PGM(QCLSCAN) PARM(&STRING &STRLEN &STRPOS +
                          &PATTERN &PATLEN &TRANSLATE &TRIM &WILD +
                          &RESULT)
             /*** If a '1' was found then that was the key pressed.     ***/
             IF         COND(&RESULT *NE 0) THEN(DO)
                CHGVAR     VAR(&MSGC) VALUE(&RESULT)
                CHGVAR     VAR(&MSGID) VALUE('MNU0' *CAT '3' *CAT +
                             %SST(&MSGC 2 2))
                RTVMSG     MSGID(&MSGID) MSGF(POPMNU) SECLVL(&COMMAND)
                CALL       PGM(QCMDEXC) PARM(&COMMAND 1024)
             ENDDO

/***                                                                    ***/
/*** If RollDown was pressed, change the menu.                          ***/
/***                                                                    ***/
             IF         COND(&IN25) THEN(DO)
                CHGVAR     VAR(&SUBMENUN) VALUE(&SUBMENU)
                CHGVAR     VAR(&SUBMENUN) VALUE(&SUBMENUN + 1)
                MONMSG     MSGID(CPF0000) EXEC(CHGVAR VAR(&SUBMENUN) +
                             VALUE(0))
                CHGVAR     VAR(&SUBMENU) VALUE(&SUBMENUN)
                GOTO       CMDLBL(END_HOUSEK)
             ENDDO

/***                                                                    ***/
/*** If RollUp was pressed, change the menu.                            ***/
/***                                                                    ***/
             IF         COND(&IN26) THEN(DO)
                CHGVAR     VAR(&SUBMENUN) VALUE(&SUBMENU)
                CHGVAR     VAR(&SUBMENUN) VALUE(&SUBMENUN - 1)
                IF         COND(&SUBMENUN *LT 0) THEN(CHGVAR +
                             VAR(&SUBMENUN) VALUE(9))
                CHGVAR     VAR(&SUBMENU) VALUE(&SUBMENUN)
                GOTO       CMDLBL(END_HOUSEK)
             ENDDO


/***                                                                    ***/
/*** If help is pressed...                                              ***/
/***                                                                    ***/

             IF         COND(&IN98) THEN(DO)
/***                                                                    ***/
/*** Get the current cursor position and set up the location of the     ***/
/*** reverse image around the command.                                  ***/
/***                                                                    ***/

/***                                                                    ***/
/*** If the row is 24 and the column is 23-24, show the help screen.    ***/
/***                                                                    ***/
                IF         COND(&S1RTNROW = 24 *AND (&S1RTNCOL = 23 +
                             *OR &S1RTNCOL = 24)) THEN(DO)
                   SNDRCVF    RCDFMT(SCRN02)
                   GOTO       CMDLBL(SNDF)
                ENDDO

/***                                                                    ***/
/*** Otherwise, circle the menu option and show the underlying command. ***/
/***                                                                    ***/
                CHGVAR     VAR(&@ROW1) VALUE(&S1RTNROW - 1)
                CHGVAR     VAR(&@COL1) VALUE(&S1RTNCOL)
                IF         COND(&@COL1 *LT 19) THEN(CHGVAR +
                             VAR(&@COL1) VALUE(1))
                ELSE       CMD(IF COND(&@COL1 *GT 20 *AND &@COL1 +
                             *LT 38) THEN(CHGVAR VAR(&@COL1) +
                             VALUE(19)))
                ELSE       CMD(IF COND(&@COL1 *GT 39 *AND &@COL1 +
                             *LT 58) THEN(CHGVAR VAR(&@COL1) +
                             VALUE(38)))
                ELSE       CMD(IF COND(&@COL1 *GT 58) THEN(CHGVAR +
                             VAR(&@COL1) VALUE(57)))

                CHGVAR     VAR(&POS1) VALUE(((&@ROW1 - 2) * 80) + +
                             &@COL1 + 2)
                IF         COND(&@COL1 *LT 19) THEN(CHGVAR +
                             VAR(&POS1) VALUE(&POS1 - 1))

/***                                                                    ***/
/*** Get the menu option, put it into the message id and retrieve the   ***/
/*** message description.                                               ***/
/***                                                                    ***/
                CHGVAR     VAR(&@MENU1) VALUE(%SST(&FLD001 &POS1 20))

                CHGVAR     VAR(&MSGID) VALUE('MNU' *CAT &SUBMENU *CAT +
                             '0' *CAT %SST(&@MENU1 1 2))
                IF         COND(%SST(&MSGID 6 1) *EQ ' ') THEN( +
                             CHGVAR VAR(%SST(&MSGID 6 1)) VALUE('0'))
                RTVMSG     MSGID(&MSGID) MSGF(POPMNU) SECLVL(&@CMD)

/***                                                                    ***/
/*** Set the row and column for the command window to display.          ***/
/***                                                                    ***/
                CHGVAR     VAR(&@ROW) VALUE(&@ROW1 - 4)
                IF         COND(&@ROW *LT 2) THEN(CHGVAR VAR(&@ROW) +
                             VALUE(8))
                CHGVAR     VAR(&@COL) VALUE(&@COL1)
                IF         COND(&@COL *GT 17) THEN(CHGVAR +
                             VAR(&@COL) VALUE(17))

/***                                                                    ***/
/*** Circle the menu option and display the command that underlies it.  ***/
/***                                                                    ***/
                SNDF       RCDFMT(SCRN08)
                SNDRCVF    RCDFMT(SCRN07)

                CHGVAR     VAR(&SINP) VALUE('  ')
                GOTO       CMDLBL(DISPLAY)
             ENDDO

/***                                                                    ***/
/*** Correct for two characters if one entered.                         ***/
/***                                                                    ***/

             IF         COND((%SST(&SINP 2 1) *EQ ' ') *AND +
                          (%SST(&SINP 1 1) *NE ' ')) THEN(DO)
                CHGVAR     VAR(%SST(&SINP 2 1)) +
                             VALUE(%SST(&SINP 1 1))
                CHGVAR     VAR(%SST(&SINP 1 1)) VALUE('0')
             ENDDO

/***                                                                    ***/
/*** Handle the F24=Signoff or option 99=Signoff.                       ***/
/***                                                                    ***/
             IF         COND(&IN21) THEN(GOTO CMDLBL(ENDPGM))

/*�          IF         COND(&IN24 *OR &SINP *EQ '99') THEN(DO)�*/
             IF         COND(&SINP *EQ '99') THEN(DO)
                IF         COND(&NBR1 *EQ &LETTER) THEN(DO)
                   CHGDTAARA  DTAARA(POPMNU (101 2)) VALUE('  ')
                   CHGDTAARA  DTAARA(POPMNU (21 10)) +
                                VALUE('          ')
                ENDDO
                ELSE       CMD(IF COND(&NBR2 *EQ &LETTER) THEN(DO))
                   CHGDTAARA  DTAARA(POPMNU (103 2)) VALUE('  ')
                   CHGDTAARA  DTAARA(POPMNU (31 10)) +
                                VALUE('          ')
                ENDDO
                ELSE       CMD(IF COND(&NBR3 *EQ &LETTER) THEN(DO))
                   CHGDTAARA  DTAARA(POPMNU (105 2)) VALUE('  ')
                   CHGDTAARA  DTAARA(POPMNU (41 10)) +
                                VALUE('          ')
                ENDDO
                ELSE       CMD(IF COND(&NBR4 *EQ &LETTER) THEN(DO))
                   CHGDTAARA  DTAARA(POPMNU (107 2)) VALUE('  ')
                   CHGDTAARA  DTAARA(POPMNU (51 10)) +
                                VALUE('          ')
                ENDDO
                ELSE       CMD(IF COND(&NBR5 *EQ &LETTER) THEN(DO))
                   CHGDTAARA  DTAARA(POPMNU (109 2)) VALUE('  ')
                   CHGDTAARA  DTAARA(POPMNU (61 10)) +
                                VALUE('          ')
                ENDDO
                SIGNOFF
             ENDDO

/***                                                                    ***/
/*** Option 98 shows the defined group jobs.                            ***/
/***                                                                    ***/

             IF         COND(&SINP *EQ '98') THEN(DO)
                CHGVAR     VAR(&SUB) VALUE(80)
                CHGVAR     VAR(&IN41) VALUE('1')
                CHGVAR     VAR(&IN42) VALUE('1')
                CHGVAR     VAR(&IN43) VALUE('1')
                CHGVAR     VAR(&IN44) VALUE('1')
                CHGVAR     VAR(&IN45) VALUE('1')
                CHGVAR     VAR(&IN46) VALUE('1')
                CHGVAR     VAR(&IN47) VALUE('1')
                CHGVAR     VAR(&IN48) VALUE('1')
                CHGVAR     VAR(&IN49) VALUE('1')
                CHGVAR     VAR(&IN50) VALUE('1')
                CHGVAR     VAR(&IN51) VALUE('1')
                CHGVAR     VAR(&IN52) VALUE('1')
                CHGVAR     VAR(&IN53) VALUE('1')
                CHGVAR     VAR(&IN54) VALUE('1')
                CHGVAR     VAR(&IN55) VALUE('1')
                CHGVAR     VAR(&IN56) VALUE('1')

                CHGVAR     VAR(&S15GRP1) VALUE(' ')
                CHGVAR     VAR(&S15GRPD1) VALUE(' ')
                CHGVAR     VAR(&S15GRP2) VALUE(' ')
                CHGVAR     VAR(&S15GRPD2) VALUE(' ')
                CHGVAR     VAR(&S15GRP3) VALUE(' ')
                CHGVAR     VAR(&S15GRPD3) VALUE(' ')
                CHGVAR     VAR(&S15GRP4) VALUE(' ')
                CHGVAR     VAR(&S15GRPD4) VALUE(' ')
                CHGVAR     VAR(&S15GRP5) VALUE(' ')
                CHGVAR     VAR(&S15GRPD5) VALUE(' ')
                CHGVAR     VAR(&S15GRP6) VALUE(' ')
                CHGVAR     VAR(&S15GRPD6) VALUE(' ')
                CHGVAR     VAR(&S15GRP7) VALUE(' ')
                CHGVAR     VAR(&S15GRPD7) VALUE(' ')
                CHGVAR     VAR(&S15GRP8) VALUE(' ')
                CHGVAR     VAR(&S15GRPD8) VALUE(' ')
                CHGVAR     VAR(&S15GRP9) VALUE(' ')
                CHGVAR     VAR(&S15GRPD9) VALUE(' ')
                CHGVAR     VAR(&S15GRP10) VALUE(' ')
                CHGVAR     VAR(&S15GRPD10) VALUE(' ')
                CHGVAR     VAR(&S15GRP11) VALUE(' ')
                CHGVAR     VAR(&S15GRPD11) VALUE(' ')
                CHGVAR     VAR(&S15GRP12) VALUE(' ')
                CHGVAR     VAR(&S15GRPD12) VALUE(' ')
                CHGVAR     VAR(&S15GRP13) VALUE(' ')
                CHGVAR     VAR(&S15GRPD13) VALUE(' ')
                CHGVAR     VAR(&S15GRP14) VALUE(' ')
                CHGVAR     VAR(&S15GRPD14) VALUE(' ')
                CHGVAR     VAR(&S15GRP15) VALUE(' ')
                CHGVAR     VAR(&S15GRPD15) VALUE(' ')
                CHGVAR     VAR(&S15GRP16) VALUE(' ')
                CHGVAR     VAR(&S15GRPD16) VALUE(' ')

                GOTO       CMDLBL(GETDEFGRP)
             ENDDO

/***                                                                    ***/
/*** Option 96 edits a menu option.                                     ***/
/***                                                                    ***/

             IF         COND(&SINP *EQ '96') THEN(DO)
                GOTO       CMDLBL(CHGMENUOPT)
ReturnMenu:
                CHGVAR     VAR(&SINP) VALUE('  ')
                GOTO       CMDLBL(DISPLAY)
             ENDDO


/***                                                                    ***/
/*** Option 97 - get new lock password.                                 ***/
/***                                                                    ***/

             IF         COND(&SINP *EQ '97') THEN(DO)
                CHGVAR     VAR(&@ONE) VALUE(0)
                CHGVAR     VAR(&@TWO) VALUE(0)
                CHGVAR     VAR(&@THREE) VALUE(0)
                CHGVAR     VAR(&@FOUR) VALUE(0)

/***                                                                    ***/
/*** Display blank options for the current and get the new ones.        ***/
/***                                                                    ***/
                SNDRCVF    RCDFMT(SCRN06)
                IF         COND(&IN03 *OR &IN12) THEN(GOTO +
                             CMDLBL(SKIPNEW))
/***                                                                    ***/
/*** Update the data area.                                              ***/
/***                                                                    ***/
                CHGVAR     VAR(&ONE) VALUE(&@ONE)
                CHGVAR     VAR(&TWO) VALUE(&@TWO)
                CHGVAR     VAR(&THREE) VALUE(&@THREE)
                CHGVAR     VAR(&FOUR) VALUE(&@FOUR)

                CHGDTAARA  DTAARA(POPMNU (193 2)) VALUE(&ONE)
                CHGDTAARA  DTAARA(POPMNU (195 2)) VALUE(&TWO)
                CHGDTAARA  DTAARA(POPMNU (197 2)) VALUE(&THREE)
                CHGDTAARA  DTAARA(POPMNU (199 2)) VALUE(&FOUR)

/***                                                                    ***/
/*** Clear the options.                                                 ***/
/***                                                                    ***/
                CHGVAR     VAR(&ONE) VALUE('  ')
                CHGVAR     VAR(&TWO) VALUE('  ')
                CHGVAR     VAR(&THREE) VALUE('  ')
                CHGVAR     VAR(&FOUR) VALUE('  ')

                CHGVAR     VAR(&@ONE) VALUE(0)
                CHGVAR     VAR(&@TWO) VALUE(0)
                CHGVAR     VAR(&@THREE) VALUE(0)
                CHGVAR     VAR(&@FOUR) VALUE(0)

SkipNew:
                CHGVAR     VAR(&SINP) VALUE('  ')
                GOTO       CMDLBL(DISPLAY)
             ENDDO

/***                                                                    ***/
/*** Options that can't be handled from the message file.               ***/
/***                                                                    ***/

/***                                                                    ***/
/*** Option 93 - end all of the group jobs except SIGNON.               ***/
/***                                                                    ***/

             IF         COND(&SINP *EQ '93') THEN(DO)
                RTVGRPA    GRPJOB(&GRPJOB) GRPJOBL(&GRPLIST)
/***                                                                    ***/
/*** Get the name of each active group job.                             ***/
/***                                                                    ***/
                CHGVAR     VAR(&GROUP1) VALUE(%SST(&GRPLIST 1 10))
                CHGVAR     VAR(&GROUP2) VALUE(%SST(&GRPLIST 67 10))
                CHGVAR     VAR(&GROUP3) VALUE(%SST(&GRPLIST 133 10))
                CHGVAR     VAR(&GROUP4) VALUE(%SST(&GRPLIST 199 10))
                CHGVAR     VAR(&GROUP5) VALUE(%SST(&GRPLIST 265 10))
                CHGVAR     VAR(&GROUP6) VALUE(%SST(&GRPLIST 331 10))
                CHGVAR     VAR(&GROUP7) VALUE(%SST(&GRPLIST 397 10))
                CHGVAR     VAR(&GROUP8) VALUE(%SST(&GRPLIST 463  10))
                CHGVAR     VAR(&GROUP9) VALUE(%SST(&GRPLIST 529  10))
                CHGVAR     VAR(&GROUP10) VALUE(%SST(&GRPLIST 595 10))
                CHGVAR     VAR(&GROUP11) VALUE(%SST(&GRPLIST 661 10))
                CHGVAR     VAR(&GROUP12) VALUE(%SST(&GRPLIST 727 10))
                CHGVAR     VAR(&GROUP13) VALUE(%SST(&GRPLIST 793 10))
                CHGVAR     VAR(&GROUP14) VALUE(%SST(&GRPLIST 859 10))
                CHGVAR     VAR(&GROUP15) VALUE(%SST(&GRPLIST 925 10))
                CHGVAR     VAR(&GROUP16) VALUE(%SST(&GRPLIST 991 10))

                IF         COND(&GROUP1 *NE ' ' *AND &GROUP1 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP1))
                IF         COND(&GROUP2 *NE ' ' *AND &GROUP2 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP2))
                IF         COND(&GROUP3 *NE ' ' *AND &GROUP3 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP3))
                IF         COND(&GROUP4 *NE ' ' *AND &GROUP4 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP4))
                IF         COND(&GROUP5 *NE ' ' *AND &GROUP5 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP5))
                IF         COND(&GROUP6 *NE ' ' *AND &GROUP6 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP6))
                IF         COND(&GROUP7 *NE ' ' *AND &GROUP7 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP7))
                IF         COND(&GROUP8 *NE ' ' *AND &GROUP8 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP8))
                IF         COND(&GROUP9 *NE ' ' *AND &GROUP9 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP9))
                IF         COND(&GROUP10 *NE ' ' *AND &GROUP10 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP10))
                IF         COND(&GROUP11 *NE ' ' *AND &GROUP11 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP11))
                IF         COND(&GROUP12 *NE ' ' *AND &GROUP12 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP12))
                IF         COND(&GROUP13 *NE ' ' *AND &GROUP13 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP13))
                IF         COND(&GROUP14 *NE ' ' *AND &GROUP14 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP14))
                IF         COND(&GROUP15 *NE ' ' *AND &GROUP15 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP15))
                IF         COND(&GROUP16 *NE ' ' *AND &GROUP16 *NE +
                             'SIGNON') THEN(ENDGRPJOB GRPJOB(&GROUP16))
             ENDDO

/***                                                                    ***/
/*** Option 90 - select menu to show 0-9.                               ***/
/***                                                                    ***/

             IF         COND(&SINP *EQ '90') THEN(DO)
                CHGVAR     VAR(&SINP) VALUE(' ')

                 /*** Get the menu titles from the data area.           ***/
                 RTVDTAARA  DTAARA(POPMNU (302 30)) RTNVAR(&S16MENU0)
                 RTVDTAARA  DTAARA(POPMNU (332 30)) RTNVAR(&S16MENU1)
                 RTVDTAARA  DTAARA(POPMNU (362 30)) RTNVAR(&S16MENU2)
                 RTVDTAARA  DTAARA(POPMNU (392 30)) RTNVAR(&S16MENU3)
                 RTVDTAARA  DTAARA(POPMNU (422 30)) RTNVAR(&S16MENU4)
                 RTVDTAARA  DTAARA(POPMNU (452 30)) RTNVAR(&S16MENU5)
                 RTVDTAARA  DTAARA(POPMNU (482 30)) RTNVAR(&S16MENU6)
                 RTVDTAARA  DTAARA(POPMNU (512 30)) RTNVAR(&S16MENU7)
                 RTVDTAARA  DTAARA(POPMNU (542 30)) RTNVAR(&S16MENU8)
                 RTVDTAARA  DTAARA(POPMNU (572 30)) RTNVAR(&S16MENU9)

                /*** Show the menu selection display.                   ***/
                SNDRCVF    RCDFMT(SCRN16)
                IF         COND(&IN12 *EQ '0') THEN(DO)
                   If (&s16Opt0 *ne ' ') ChgVar &SubMenu '0'
                   If (&s16Opt1 *ne ' ') ChgVar &SubMenu '1'
                   If (&s16Opt2 *ne ' ') ChgVar &SubMenu '2'
                   If (&s16Opt3 *ne ' ') ChgVar &SubMenu '3'
                   If (&s16Opt4 *ne ' ') ChgVar &SubMenu '4'
                   If (&s16Opt5 *ne ' ') ChgVar &SubMenu '5'
                   If (&s16Opt6 *ne ' ') ChgVar &SubMenu '6'
                   If (&s16Opt7 *ne ' ') ChgVar &SubMenu '7'
                   If (&s16Opt8 *ne ' ') ChgVar &SubMenu '8'
                   If (&s16Opt9 *ne ' ') ChgVar &SubMenu '9'

                   /*** Reload the menu.                                ***/
                   Goto End_HouseK
                ENDDO
                GOTO       CMDLBL(DISPLAY)
             ENDDO

/***                                                                    ***/
/*** Option 91 - show screen color.                                     ***/
/***                                                                    ***/

             IF         COND(&SINP *EQ '91') THEN(DO)
                CHGVAR     VAR(&SINP) VALUE(' ')
                SNDRCVF    RCDFMT(SCRN14)
                GOTO       CMDLBL(DISPLAY)
             ENDDO

/***                                                                    ***/
/*** Option 92 - edit function keys.                                    ***/
/***                                                                    ***/

             IF         COND(&SINP *EQ '92') THEN(DO)
                CHGVAR     VAR(&SINP) VALUE(' ')
                GOTO       CMDLBL(EDITFKEYS)
             ENDDO

/***                                                                    ***/
/*** Option 94 - edit POPMNU data area.                                 ***/
/***                                                                    ***/

             IF         COND(&SINP *EQ '94') THEN(DO)
                CALL       PGM(POPMNUC)
                CHGVAR     VAR(&SINP) VALUE('  ')
                GOTO       CMDLBL(DISPLAY)
             ENDDO

/***                                                                    ***/
/*** Option 95 - lock terminal.                                         ***/
/***                                                                    ***/

             IF         COND(&SINP *EQ '95') THEN(DO)
                CHGVAR     VAR(&RETURNPNT) VALUE('OPTION95')
                CHGDTAARA  DTAARA(POPLOCK) VALUE('Y')
                GOTO       CMDLBL(SECURE1)
Option95:
                CHGVAR     VAR(&RETURNPNT) VALUE('        ')
                CHGVAR     VAR(&SINP) VALUE('  ')
                GOTO       CMDLBL(DISPLAY)
             ENDDO

/***                                                                    ***/
/*** If blank, return.                                                  ***/
/***                                                                    ***/
             CHGVAR     VAR(&GROUPJOB) VALUE('N')
             IF         COND(&SINP *NE '  ') THEN(DO)
               CHGVAR     VAR(&MSGID) VALUE('MNU' *CAT &SUBMENU *CAT +
                            '0' *CAT &SINP)
               RTVMSG     MSGID(&MSGID) MSGF(POPMNU) SECLVL(&COMMAND) +
                            LOGPRB(&GROUPJOB)
               MONMSG     MSGID(CPF0001) EXEC(DO)
                 CHGVAR     VAR(&SINP) VALUE('  ')
                 GOTO       CMDLBL(DISPLAY)
               ENDDO
             ENDDO

/***                                                                    ***/
/*** Handle group jobs - options 65-80.                                 ***/
/***                                                                    ***/

             IF         COND(&GROUPJOB *EQ 'Y') THEN(DO)
                CHGVAR     VAR(&MSGID) VALUE('MNU' *CAT &SUBMENU *CAT +
                             '0' *CAT &SINP)
                RTVMSG     MSGID(&MSGID) MSGF(POPMNU) +
                             SECLVL(&GRPTEXT)
                CHGVAR     VAR(&GROUP) VALUE(%SST(&GRPTEXT 1 10))
                CHGVAR     VAR(&TEXT) VALUE(%SST(&GRPTEXT 11 50))
                CHGVAR     VAR(&GRPPGM) VALUE(%SST(&GRPTEXT 61 10))

                IF         COND(&GRPPGM *EQ ' ') THEN(GOTO +
                             CMDLBL(DISPLAY))
                IF         COND(&GRPJOB *EQ &GROUP) THEN(RETURN)
                ELSE       CMD(DO)
                   IF         COND(&LETTER *EQ &NBR1) +
                                THEN(CHGDTAARA DTAARA(POPMNU +
                                (21 10)) VALUE(&GROUP))
                   ELSE       CMD(IF COND(&LETTER *EQ &NBR2) +
                                THEN(CHGDTAARA DTAARA(POPMNU +
                                (31 10)) VALUE(&GROUP)))
                   ELSE       CMD(IF COND(&LETTER *EQ &NBR3) +
                                THEN(CHGDTAARA DTAARA(POPMNU +
                                (41 10)) VALUE(&GROUP)))
                   ELSE       CMD(IF COND(&LETTER *EQ &NBR4) +
                                THEN(CHGDTAARA DTAARA(POPMNU +
                                (51 10)) VALUE(&GROUP)))
                   ELSE       CMD(IF COND(&LETTER *EQ &NBR5) +
                                THEN(CHGDTAARA DTAARA(POPMNU +
                                (61 10)) VALUE(&GROUP)))

                   IF (&GROUP *NE ' ') +
                   TFRGRPJOB  GRPJOB(&GROUP) INLGRPPGM(&GRPPGM) +
                                TEXT(&TEXT)

                   CHGVAR     VAR(&GETGROUP) VALUE(GROUPJOB)
                   IF         COND(&GRPJOB *NE ' ' *AND &GRPJOB +
                                *NE 'SIGNON') THEN(RETURN)
                ENDDO

                CHGVAR     VAR(&SINP) VALUE('  ')
                GOTO       CMDLBL(DISPLAY)
             ENDDO

/***                                                                    ***/
/*** If not an internal command...                                      ***/
/***                                                                    ***/

             IF         COND(&SINP *NE '  ') THEN(DO)
                IF         COND(%SST(&SINP 1 1) = ' ') THEN(CHGVAR +
                             VAR(%SST(&SINP 1 1)) VALUE('0'))
                CHGVAR     VAR(&MSGID) VALUE('MNU' *CAT &SUBMENU *CAT +
                             '0' *CAT &SINP)
                RTVMSG     MSGID(&MSGID) MSGF(POPMNU) +
                             SECLVL(&COMMAND)
                MONMSG     MSGID(CPF0001) EXEC(DO)
                   CHGVAR     VAR(&SINP) VALUE(' ')
                   GOTO       CMDLBL(SNDF)
                ENDDO

                MONMSG     MSGID(CPF2499) EXEC(GOTO CMDLBL(DISPLAY))
                IF         COND(&COMMAND *NE ' ') THEN(DO)
                     CHGVAR     VAR(&RETURNPNT) VALUE('END_EXEC')
                     GOTO       CMDLBL(SCANEXEC)
End_Exec:
                ENDDO
             ENDDO

/***                                                                    ***/
/*** Fall through...                                                    ***/
/***                                                                    ***/

             CHGVAR     VAR(&SINP) VALUE('  ')

             RTVJOBA    CURLIB(&CURLIB)
             CHGVAR     VAR(&S1CURLIB) VALUE(&CURLIB)

             RTVSYSVAL  SYSVAL(QDATE) RTNVAR(&DATE6)
             RTVDAT     CYYMMDD(&DATE7)
             CVTDAT     DATE(&DATE6) TOVAR(&DATETEST) +
                          FROMFMT(*MDY) TOFMT(*MDYY) TOSEP(/)
             CHGVAR     VAR(&S1DATE) VALUE(&DATETEST)

             GOTO       CMDLBL(DISPLAY)


/**************************************************************************/
/*** End of main program code.                                          ***/
/**************************************************************************/


/**************************************************************************/
/*** SUBROUTINE: General housekeeping stuff.                            ***/
/*** HouseKeep                                                          ***/
/**************************************************************************/
House_Keep:

/***                                                                    ***/
/*** If this is the first signon of the day then do whatever commands   ***/
/*** have been set up for this time.                                    ***/
/***                                                                    ***/
             IF         COND(&DATETEST *NE &DATETEST1) THEN(DO)
                CHGDTAARA  DTAARA(POPMNU (101 10)) VALUE(' ')

                CHGVAR     VAR(&SUB1) VALUE(200)
                CHGVAR     VAR(&RETURNPNT) VALUE('STARTDAY')
StartDay:
                CHGVAR     VAR(&SUB1) VALUE(&SUB1 + 1)
                IF         COND(&SUB1 *GT 210) THEN(GOTO +
                             CMDLBL(ENDSTART))
                CHGVAR     VAR(&MSGC) VALUE(&SUB1)
                CHGVAR     VAR(&MSGID) VALUE('MNU0' *CAT &MSGC)
                RTVMSG     MSGID(&MSGID) MSGF(POPMNU) +
                             SECLVL(&COMMAND)
                IF         COND(&COMMAND *NE ' ') THEN(GOTO +
                             CMDLBL(SCANEXEC))
                GOTO       CMDLBL(STARTDAY)
             ENDDO

EndStart:

/***                                                                    ***/
/*** Run any commands that need to be run every time we sign on.        ***/
/***                                                                    ***/

             CHGVAR     VAR(&SUB1) VALUE(210)
             CHGVAR     VAR(&RETURNPNT) VALUE('EACHTIME')
EachTime:
             CHGVAR     VAR(&SUB1) VALUE(&SUB1 + 1)
             IF         COND(&SUB1 *GT 220) THEN(GOTO CMDLBL(ENDEACH))
             CHGVAR     VAR(&MSGC) VALUE(&SUB1)
             CHGVAR     VAR(&MSGID) VALUE('MNU0' *CAT &MSGC)
             RTVMSG     MSGID(&MSGID) MSGF(POPMNU) SECLVL(&COMMAND)
             IF         COND(&COMMAND *NE ' ') THEN(GOTO +
                          CMDLBL(SCANEXEC))
             GOTO       CMDLBL(EACHTIME)

EndEach:

             CHGVAR     VAR(&S1CURLIB) VALUE(&CURLIB)
             CHGJOB     PRTKEYFMT(*NONE)

/***                                                                    ***/
/*** This is the amount of time between screen refreshes in seconds.    ***/
/***                                                                    ***/
             RTVDTAARA  DTAARA(POPMNU (186 3)) RTNVAR(&WAITTIME1)
             CHGVAR     VAR(&WAITTIME) VALUE(&WAITTIME1)
             OVRDSPF    FILE(&DISPLAYF) WAITRCD(&WAITTIME)

/***                                                                    ***/
/*** This is how long the display is inactive before locking the        ***/
/*** terminal.                                                          ***/
/***                                                                    ***/
             RTVDTAARA  DTAARA(POPMNU (189 4)) RTNVAR(&LOCKTIME1)
             CHGVAR     VAR(&LOCKTIME) VALUE(&LOCKTIME1)

             RTVSYSVAL  SYSVAL(QTIME) RTNVAR(&GETTIME)
             CHGVAR     VAR(&HOLDTIME1) VALUE(&GETTIME)
             CHGVAR     VAR(&HOLDTIME) VALUE(&GETTIME)
             CHGDTAARA  DTAARA(POPMNU (171 6)) VALUE(&HOLDTIME)

/***                                                                    ***/
/*** Get the last two characters of the job name.                       ***/
/***                                                                    ***/
             CHGVAR     VAR(&SUB) VALUE(11)
Check:
             CHGVAR     VAR(&SUB) VALUE(&SUB - 1)
             IF         COND(%SST(&JOB &SUB 1) *EQ ' ') THEN(GOTO +
                          CMDLBL(CHECK))
             CHGVAR     VAR(&SUB) VALUE(&SUB - 1)
             CHGVAR     VAR(&LETTER) VALUE(%SST(&JOB &SUB 2))

/***                                                                    ***/
/*** Get the date and convert it to ten characters with '/'.            ***/
/***                                                                    ***/
             RTVSYSVAL  SYSVAL(QDATE) RTNVAR(&DATE6)
             RTVDAT     CYYMMDD(&DATE7)
             CVTDAT     DATE(&DATE6) TOVAR(&DATETEST) +
                          FROMFMT(*MDY) TOFMT(*MDYY) TOSEP(*NONE)
             RTVDTAARA  DTAARA(POPMNU (1 10)) RTNVAR(&DATETEST1)
             CHGDTAARA  DTAARA(POPMNU (1 10)) VALUE(&DATETEST)
             CHGDTAARA  DTAARA(POPMNU (11 10)) VALUE(&ATNPGM)

/***                                                                    ***/
/*** Retrieve the user profile name.                                    ***/
/***                                                                    ***/
             RTVUSRPRF  RTNUSRPRF(&USER)

/***                                                                    ***/
/*** Set the sign-on number.                                            ***/
/***                                                                    ***/
             RTVGRPA    GRPJOB(&GRPJOB)
             IF         COND(&GRPJOB *EQ '*NONE') THEN(DO)
                RTVDTAARA  DTAARA(POPMNU (101 2)) RTNVAR(&NBR1)
                RTVDTAARA  DTAARA(POPMNU (103 2)) RTNVAR(&NBR2)
                RTVDTAARA  DTAARA(POPMNU (105 2)) RTNVAR(&NBR3)
                RTVDTAARA  DTAARA(POPMNU (107 2)) RTNVAR(&NBR4)
                RTVDTAARA  DTAARA(POPMNU (109 2)) RTNVAR(&NBR5)

                IF         COND(&NBR1 *EQ '  ') THEN(DO)
                     CHGDTAARA  DTAARA(POPMNU (101 2)) VALUE(&LETTER)
                     CHGVAR     VAR(&NBR1) VALUE(&LETTER)
                ENDDO

                ELSE       CMD(IF COND(&NBR2 *EQ '  ') THEN(DO))
                     CHGDTAARA  DTAARA(POPMNU (103 2)) VALUE(&LETTER)
                     CHGVAR     VAR(&NBR2) VALUE(&LETTER)
                ENDDO

                ELSE       CMD(IF COND(&NBR3 *EQ '  ') THEN(DO))
                     CHGDTAARA  DTAARA(POPMNU (105 2)) VALUE(&LETTER)
                     CHGVAR     VAR(&NBR3) VALUE(&LETTER)
                ENDDO

                ELSE       CMD(IF COND(&NBR4 *EQ '  ') THEN(DO))
                     CHGDTAARA  DTAARA(POPMNU (107 2)) VALUE(&LETTER)
                     CHGVAR     VAR(&NBR4) VALUE(&LETTER)
                ENDDO

                ELSE       CMD(IF COND(&NBR5 *EQ '  ') THEN(DO))
                     CHGDTAARA  DTAARA(POPMNU (109 2)) VALUE(&LETTER)
                     CHGVAR     VAR(&NBR5) VALUE(&LETTER)
                ENDDO

/***                                                                    ***/
/*** Set up the initial group job - where this menu exists.             ***/
/***                                                                    ***/
                CHGGRPA    GRPJOB(SIGNON) TEXT('Initial Sign-on +
                             group job')
                CHGVAR     VAR(&GRPJOB) VALUE(SIGNON)

             ENDDO

/***                                                                    ***/
/*** Otherwise, transfer to group job SIGNON and end the program.       ***/
/***                                                                    ***/
             ELSE       CMD(IF COND(&GRPJOB *NE 'SIGNON' *AND +
                          &GRPJOB *NE '          ') THEN(DO))
                TFRGRPJOB  GRPJOB(SIGNON)
                GOTO       CMDLBL(ENDPGM)
             ENDDO


             GOTO       CMDLBL(END_HOUSEK)
/**************************************************************************/
/*** End of subroutine House_Keep                                       ***/
/**************************************************************************/


/**************************************************************************/
/*** SUBROUTINE: Load the menu options to the screen.                   ***/
/*** Load_Scren                                                         ***/
/**************************************************************************/
Load_Scren:

Restart:
             CHGVAR     VAR(&FLD001) VALUE(' ')
             CHGVAR     VAR(&MSG#) VALUE(0)
             CHGVAR     VAR(&SUB) VALUE(-78)
             CHGVAR     VAR(&HOLDSUB) VALUE(2)
             CHGVAR     VAR(&GROUPJOB#) VALUE(0)
/***                                                                    ***/
/*** Set the refresh time.                                              ***/
/***                                                                    ***/
             RTVDTAARA  DTAARA(POPMNU (186 3)) RTNVAR(&WAITTIME1)
             CHGVAR     VAR(&WAITTIME) VALUE(&WAITTIME1)
             DLTOVR     FILE(&DISPLAYF)
             OVRDSPF    FILE(&DISPLAYF) WAITRCD(&WAITTIME)

/***                                                                    ***/
/*** This is how long the display is inactive before locking the        ***/
/*** terminal.                                                          ***/
/***                                                                    ***/
             RTVDTAARA  DTAARA(POPMNU (189 4)) RTNVAR(&LOCKTIME1)
             CHGVAR     VAR(&LOCKTIME) VALUE(&LOCKTIME1)

             RTVSYSVAL  SYSVAL(QTIME) RTNVAR(&GETTIME)
             CHGVAR     VAR(&HOLDTIME1) VALUE(&GETTIME)
             CHGVAR     VAR(&HOLDTIME) VALUE(&GETTIME)
             CHGDTAARA  DTAARA(POPMNU (171 6)) VALUE(&HOLDTIME)

/**************************************************************************/

/***                                                                    ***/
/*** First, get the group job menu items.                               ***/
/***                                                                    ***/

             CHGVAR     VAR(&SUB) VALUE(-1)
             CHGVAR     VAR(&SUB1) VALUE(0)
StartGrp:
             CHGVAR     VAR(&SUB) VALUE(&SUB + 2)
             CHGVAR     VAR(&SUB1) VALUE(&SUB1 + 1)
             IF         COND(&SUB *GT 32) THEN(DO)
               CHGVAR     VAR(&SUB) VALUE(-78)
               GOTO       CMDLBL(LOAD)
             ENDDO

             CHGVAR     VAR(&MSGID) VALUE('MNU99' *CAT +
                          %SST(&GROUPLIST &SUB 2))
             CHGVAR     VAR(&FIELD) VALUE(' ')
             RTVMSG     MSGID(&MSGID) MSGF(POPMNU) MSG(&FIELD) +
                          SECLVL(&COMMAND)

/***                                                                    ***/
/*** Add the message if it doesn't exist.                               ***/
/***                                                                    ***/
             IF         COND(&FIELD *EQ 'Text not available ') THEN(DO)
               CHGVAR     VAR(&LTR2) VALUE(%SST(&GROUPLISTA &SUB1 1))
                CHGVAR     VAR(&LTR2) VALUE(&LTR2 *TCAT '.')
                ADDMSGD    MSGID(&MSGID) MSGF(POPMNU) MSG(&LTR2)
               GOTO       CMDLBL(STARTGRP)
             ENDDO


/***                                                                    ***/
/*** Set the group job number.                                          ***/
/***                                                                    ***/
             IF         COND(%SST(&COMMAND 7 1) *EQ ' ') THEN(DO)
                CHGVAR     VAR(&GROUPJOB#1) VALUE('0' *CAT +
                             %SST(&COMMAND 6 1))
                CHGVAR     VAR(&GROUPJOB#) VALUE(&GROUPJOB#1)
             ENDDO
             ELSE       CMD(DO)
                CHGVAR     VAR(&GROUPJOB#1) VALUE(%SST(&COMMAND +
                             6 2))
                CHGVAR     VAR(&GROUPJOB#) VALUE(&GROUPJOB#1)
             ENDDO

/***                                                                    ***/
/*** Save the hilight positions for each group job.                     ***/
/***                                                                    ***/
             IF         COND(&GROUPJOB# = 1) THEN(DO)
               CHGVAR     VAR(&GROUP1S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP1E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 2) THEN(DO)
               CHGVAR     VAR(&GROUP2S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP2E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 3) THEN(DO)
               CHGVAR     VAR(&GROUP3S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP3E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 4) THEN(DO)
               CHGVAR     VAR(&GROUP4S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP4E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 5) THEN(DO)
               CHGVAR     VAR(&GROUP5S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP5E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 6) THEN(DO)
               CHGVAR     VAR(&GROUP6S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP6E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 7) THEN(DO)
               CHGVAR     VAR(&GROUP7S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP7E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 8) THEN(DO)
               CHGVAR     VAR(&GROUP8S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP8E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 9) THEN(DO)
               CHGVAR     VAR(&GROUP9S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP9E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 10) THEN(DO)
               CHGVAR     VAR(&GROUP10S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP10E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 11) THEN(DO)
               CHGVAR     VAR(&GROUP11S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP11E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 12) THEN(DO)
               CHGVAR     VAR(&GROUP12S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP12E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 13) THEN(DO)
               CHGVAR     VAR(&GROUP13S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP13E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 14) THEN(DO)
               CHGVAR     VAR(&GROUP14S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP14E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 15) THEN(DO)
               CHGVAR     VAR(&GROUP15S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP15E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             IF COND(&GROUPJOB# = 16) THEN(DO)
               CHGVAR     VAR(&GROUP16S) VALUE(%SST(&COMMAND 71 4))
               CHGVAR     VAR(&GROUP16E) VALUE(%SST(&COMMAND 75 4))
             ENDDO
             GOTO       CMDLBL(STARTGRP)

/**************************************************************************/

/***                                                                    ***/
/*** Load the menu values.                                              ***/
/***                                                                    ***/
Load:
             CHGVAR     VAR(&SUB) VALUE(&SUB + 80)
             IF         COND(&SUB *GT 1585) THEN(DO)
                CHGVAR     VAR(&HOLDSUB) VALUE(&HOLDSUB + 19)
                CHGVAR     VAR(&SUB) VALUE(&HOLDSUB)
             ENDDO

             CHGVAR     VAR(&MSG#) VALUE(&MSG# + 1)
             CHGVAR     VAR(&MSGC) VALUE(&MSG#)
             CHGVAR     VAR(&MSGID) VALUE('MNU' *CAT &SUBMENU *CAT +
                          &MSGC)
Retrieve:
             RTVMSG     MSGID(&MSGID) MSGF(POPMNU) MSG(&MSGDTA) +
                          SECLVL(&COMMAND) LOGPRB(&GROUPJOB)
             CHGVAR     VAR(&FIELD) VALUE(%SST(&MSGDTA 1 19))
             CHGVAR     VAR(&COLOR) VALUE(%SST(&MSGDTA 21 2))

             /*** Add the message if it doesn't exist.                  ***/
             IF         COND(&FIELD *EQ 'Text not available ') THEN(DO)
                CHGVAR     VAR(&LTR2) VALUE(%SST(&MSGC 2 2))
                IF         COND(%SST(&LTR2 1 1) *EQ '0') THEN(CHGVAR +
                             VAR(%SST(&LTR2 1 1)) VALUE(' '))
                ADDMSGD    MSGID(&MSGID) MSGF(POPMNU) MSG(&LTR2 *CAT +
                             '.')
                GOTO       CMDLBL(RETRIEVE)
             ENDDO

             CHGVAR     VAR(%SST(&FLD001 &SUB 19)) VALUE(&SCRNCLR +
                          *TCAT &FIELD)

/***                                                                    ***/
/*** Set the color for the menu option if defined.                      ***/
/***                                                                    ***/
             CHGVAR     VAR(&CLRFLD) VALUE(X'20')

             IF (&COLOR *NE ' ') DO
                IF (&COLOR *EQ '21') CHGVAR &CLRFLD (X'21')
                IF (&COLOR *EQ '22') CHGVAR &CLRFLD (X'22')
                IF (&COLOR *EQ '23') CHGVAR &CLRFLD (X'23')
                IF (&COLOR *EQ '24') CHGVAR &CLRFLD (X'24')
                IF (&COLOR *EQ '25') CHGVAR &CLRFLD (X'25')
                IF (&COLOR *EQ '26') CHGVAR &CLRFLD (X'26')
                IF (&COLOR *EQ '28') CHGVAR &CLRFLD (X'28')
                IF (&COLOR *EQ '29') CHGVAR &CLRFLD (X'29')
                IF (&COLOR *EQ '2C') CHGVAR &CLRFLD (X'2C')
                IF (&COLOR *EQ '2D') CHGVAR &CLRFLD (X'2D')
                IF (&COLOR *EQ '30') CHGVAR &CLRFLD (X'30')
                IF (&COLOR *EQ '31') CHGVAR &CLRFLD (X'31')
                IF (&COLOR *EQ '32') CHGVAR &CLRFLD (X'32')
                IF (&COLOR *EQ '33') CHGVAR &CLRFLD (X'33')
                IF (&COLOR *EQ '34') CHGVAR &CLRFLD (X'34')
                IF (&COLOR *EQ '35') CHGVAR &CLRFLD (X'35')
                IF (&COLOR *EQ '36') CHGVAR &CLRFLD (X'36')
                IF (&COLOR *EQ '38') CHGVAR &CLRFLD (X'38')
                IF (&COLOR *EQ '39') CHGVAR &CLRFLD (X'39')
                IF (&COLOR *EQ '3A') CHGVAR &CLRFLD (X'3A')
                IF (&COLOR *EQ '3B') CHGVAR &CLRFLD (X'3B')
                IF (&COLOR *EQ '3C') CHGVAR &CLRFLD (X'3C')
                IF (&COLOR *EQ '3D') CHGVAR &CLRFLD (X'3D')
                IF (&COLOR *EQ '3E') CHGVAR &CLRFLD (X'3E')

                CHGVAR     VAR(&SUB) VALUE(&SUB - 1)
                CHGVAR     VAR(%SST(&FLD001 &SUB 1)) VALUE(&CLRFLD)
                CHGVAR     VAR(&SUB) VALUE(&SUB + 19)
                CHGVAR     VAR(%SST(&FLD001 &SUB 1)) VALUE(X'20')
                CHGVAR     VAR(&SUB) VALUE(&SUB - 18)
             ENDDO

/*** Return to get the next menu option.                                ***/
             IF         COND(&MSG# *LT 80) THEN(GOTO CMDLBL(LOAD))

/**************************************************************************/

/***                                                                    ***/
/*** Set up the fields that never change.                               ***/
/***                                                                    ***/
             CHGVAR     VAR(&S1BLANK) +
                          VALUE('                                     -
                                          ')

             CHGVAR     VAR(&FLD094) VALUE('Enter Option Number:')

/*** Retrieve the heading for the current menu.                         ***/
             CHGVAR     VAR(&HEADSTART) VALUE(&SUBMENU)
             CHGVAR     VAR(&HEADOFFSET) VALUE(&HEADSTART * 30)
             CHGVAR     VAR(&HEADOFFSET) VALUE(302 + &HEADOFFSET)
             RTVDTAARA  DTAARA(POPMNU (&HEADOFFSET 30)) +
                          RTNVAR(&HEADING)

/*** Center the heading.                                                ***/
             CHGVAR     VAR(&HEADINGLEN) VALUE(58)
             CALL       PGM(CENTER) PARM(&HEADING &HEADINGLEN)
             CHGVAR     VAR(&S1HEADING) VALUE(&HEADING)

/*** Return to the calling position.                                    ***/
             IF         COND(&RETURNPNT *EQ 'RESTART') THEN(GOTO +
                          CMDLBL(DISPLAY))
             IF         COND(&RETURNPNT *EQ 'STACKCMD') THEN(GOTO +
                          CMDLBL(STACKCMD))
             IF         COND(&RETURNPNT *EQ 'REFRSHDONE') THEN(GOTO +
                          CMDLBL(REFRSHDONE))

             GOTO       CMDLBL(END_LOAD)
/**************************************************************************/
/*** End of subroutine Load_Scren.                                      ***/
/**************************************************************************/


/**************************************************************************/
/*** SUBROUTINE: Get the list of active group jobs, hilight active jobs ***/
/*** GetGrpList� and reverse image the current job.                     ***/
/**************************************************************************/
GetGrpList:
             CHGVAR     VAR(&NORM) VALUE(X'20')
             CHGVAR     VAR(&HIGH) VALUE(X'22')
             CHGVAR     VAR(&HIREV) VALUE(X'33')
/***                                                                    ***/
/*** Retrieve the list of active group jobs.                            ***/
/***                                                                    ***/
             RTVGRPA    GRPJOB(&GRPJOB) GRPJOBL(&GRPLIST)

/***                                                                    ***/
/*** Get the name of each active group job.                             ***/
/***                                                                    ***/
             CHGVAR     VAR(&GROUP1) VALUE(%SST(&GRPLIST 1 10))
             CHGVAR     VAR(&GROUP2) VALUE(%SST(&GRPLIST 67 10))
             CHGVAR     VAR(&GROUP3) VALUE(%SST(&GRPLIST 133 10))
             CHGVAR     VAR(&GROUP4) VALUE(%SST(&GRPLIST 199 10))
             CHGVAR     VAR(&GROUP5) VALUE(%SST(&GRPLIST 265 10))
             CHGVAR     VAR(&GROUP6) VALUE(%SST(&GRPLIST 331 10))
             CHGVAR     VAR(&GROUP7) VALUE(%SST(&GRPLIST 397 10))
             CHGVAR     VAR(&GROUP8) VALUE(%SST(&GRPLIST 463  10))
             CHGVAR     VAR(&GROUP9) VALUE(%SST(&GRPLIST 529  10))
             CHGVAR     VAR(&GROUP10) VALUE(%SST(&GRPLIST 595 10))
             CHGVAR     VAR(&GROUP11) VALUE(%SST(&GRPLIST 661 10))
             CHGVAR     VAR(&GROUP12) VALUE(%SST(&GRPLIST 727 10))
             CHGVAR     VAR(&GROUP13) VALUE(%SST(&GRPLIST 793 10))
             CHGVAR     VAR(&GROUP14) VALUE(%SST(&GRPLIST 859 10))
             CHGVAR     VAR(&GROUP15) VALUE(%SST(&GRPLIST 925 10))
             CHGVAR     VAR(&GROUP16) VALUE(%SST(&GRPLIST 991 10))

/***                                                                    ***/
/*** Clear the active and current markers.                              ***/
/***                                                                    ***/

             CHGVAR     VAR(&GROUP1L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP2L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP3L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP4L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP5L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP6L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP7L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP8L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP9L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP10L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP11L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP12L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP13L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP14L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP15L) VALUE(&NORM)
             CHGVAR     VAR(&GROUP16L) VALUE(&NORM)

/***                                                                    ***/
/*** Any group job that is active will be hilighted - not reverse       ***/
/*** imaged.                                                            ***/
/***                                                                    ***/
             IF         COND((&GROUP1 *EQ 'GROUP1') *OR (&GROUP2 *EQ +
                          'GROUP1') *OR (&GROUP3 *EQ 'GROUP1') *OR (&GROUP4 +
                          *EQ 'GROUP1') *OR (&GROUP5 *EQ 'GROUP1') *OR +
                          (&GROUP6 *EQ 'GROUP1') *OR (&GROUP7 *EQ 'GROUP1') +
                          *OR (&GROUP8 *EQ 'GROUP1') *OR (&GROUP9 *EQ +
                          'GROUP1') *OR (&GROUP10 *EQ 'GROUP1') *OR +
                          (&GROUP11 *EQ 'GROUP1') *OR (&GROUP12 *EQ +
                          'GROUP1') *OR (&GROUP13 *EQ 'GROUP1') *OR +
                          (&GROUP15 *EQ 'GROUP1') *OR (&GROUP16 *EQ +
                          'GROUP1') *OR +
                          (&GROUP14 *EQ 'GROUP1')) THEN(CHGVAR +
                          VAR(&GROUP1L) VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP2') *OR (&GROUP2 *EQ +
                          'GROUP2') *OR (&GROUP3 *EQ 'GROUP2') *OR (&GROUP4 +
                          *EQ 'GROUP2') *OR (&GROUP5 *EQ 'GROUP2') *OR +
                          (&GROUP6 *EQ 'GROUP2') *OR (&GROUP7 *EQ 'GROUP2') +
                          *OR (&GROUP8 *EQ 'GROUP2') *OR (&GROUP9 *EQ +
                          'GROUP2') *OR (&GROUP10 *EQ 'GROUP2') *OR +
                          (&GROUP11 *EQ 'GROUP2') *OR (&GROUP12 *EQ +
                          'GROUP2') *OR (&GROUP13 *EQ 'GROUP2') *OR +
                          (&GROUP15 *EQ 'GROUP2') *OR (&GROUP16 *EQ +
                          'GROUP2') *OR +
                          (&GROUP14 *EQ 'GROUP2')) THEN(CHGVAR +
                          VAR(&GROUP2L) VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP3') *OR (&GROUP2 *EQ +
                          'GROUP3') *OR (&GROUP3 *EQ 'GROUP3') *OR (&GROUP4 +
                          *EQ 'GROUP3') *OR (&GROUP5 *EQ 'GROUP3') *OR +
                          (&GROUP6 *EQ 'GROUP3') *OR (&GROUP7 *EQ 'GROUP3') +
                          *OR (&GROUP8 *EQ 'GROUP3') *OR (&GROUP9 *EQ +
                          'GROUP3') *OR (&GROUP10 *EQ 'GROUP3') *OR +
                          (&GROUP11 *EQ 'GROUP3') *OR (&GROUP12 *EQ +
                          'GROUP3') *OR (&GROUP13 *EQ 'GROUP3') *OR +
                          (&GROUP15 *EQ 'GROUP3') *OR (&GROUP16 *EQ +
                          'GROUP3') *OR +
                          (&GROUP14 *EQ 'GROUP3')) THEN(CHGVAR +
                          VAR(&GROUP3L) VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP4') *OR (&GROUP2 *EQ +
                          'GROUP4') *OR (&GROUP3 *EQ 'GROUP4') *OR (&GROUP4 +
                          *EQ 'GROUP4') *OR (&GROUP5 *EQ 'GROUP4') *OR +
                          (&GROUP6 *EQ 'GROUP4') *OR (&GROUP7 *EQ 'GROUP4') +
                          *OR (&GROUP8 *EQ 'GROUP4') *OR (&GROUP9 *EQ +
                          'GROUP4') *OR (&GROUP10 *EQ 'GROUP4') *OR +
                          (&GROUP11 *EQ 'GROUP4') *OR (&GROUP12 *EQ +
                          'GROUP4') *OR (&GROUP13 *EQ 'GROUP4') *OR +
                          (&GROUP15 *EQ 'GROUP4') *OR (&GROUP16 *EQ +
                          'GROUP4') *OR +
                          (&GROUP14 *EQ 'GROUP4')) THEN(CHGVAR +
                          VAR(&GROUP4L) VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP5') *OR (&GROUP2 +
                          *EQ 'GROUP5') *OR (&GROUP3 *EQ +
                          'GROUP5') *OR (&GROUP4 *EQ 'GROUP5') +
                          *OR (&GROUP5 *EQ 'GROUP5') *OR (&GROUP6 +
                          *EQ 'GROUP5') *OR (&GROUP7 *EQ +
                          'GROUP5') *OR (&GROUP8 *EQ 'GROUP5') +
                          *OR (&GROUP9 *EQ 'GROUP5') *OR (&GROUP10 +
                          *EQ 'GROUP5') *OR (&GROUP11 *EQ +
                          'GROUP5') *OR (&GROUP12 *EQ 'GROUP5') +
                          *OR (&GROUP12 *EQ 'GROUP5') *OR +
                          (&GROUP15 *EQ 'GROUP5') *OR (&GROUP16 *EQ +
                          'GROUP5') *OR +
                          (&GROUP14 *EQ 'GROUP5')) THEN(CHGVAR +
                          VAR(&GROUP5L) VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP6') *OR (&GROUP2 *EQ +
                          'GROUP6') *OR (&GROUP3 *EQ 'GROUP6') *OR +
                          (&GROUP4 *EQ 'GROUP6') *OR (&GROUP5 *EQ +
                          'GROUP6') *OR (&GROUP6 *EQ 'GROUP6') *OR +
                          (&GROUP7 *EQ 'GROUP6') *OR (&GROUP8 *EQ +
                          'GROUP6') *OR (&GROUP9 *EQ 'GROUP6') *OR +
                          (&GROUP10 *EQ 'GROUP6') *OR (&GROUP11 *EQ +
                          'GROUP6') *OR (&GROUP12 *EQ 'GROUP6') *OR +
                          (&GROUP15 *EQ 'GROUP6') *OR (&GROUP16 *EQ +
                          'GROUP6') *OR +
                          (&GROUP12 *EQ 'GROUP6') *OR (&GROUP14 *EQ +
                          'GROUP6')) THEN(CHGVAR VAR(&GROUP6L) +
                          VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP7') *OR (&GROUP2 *EQ +
                          'GROUP7') *OR (&GROUP3 *EQ 'GROUP7') *OR +
                          (&GROUP4 *EQ 'GROUP7') *OR (&GROUP5 *EQ +
                          'GROUP7') *OR (&GROUP6 *EQ 'GROUP7') *OR +
                          (&GROUP7 *EQ 'GROUP7') *OR (&GROUP8 *EQ +
                          'GROUP7') *OR (&GROUP9 *EQ 'GROUP7') *OR +
                          (&GROUP10 *EQ 'GROUP7') *OR (&GROUP11 *EQ +
                          'GROUP7') *OR (&GROUP12 *EQ 'GROUP7') *OR +
                          (&GROUP15 *EQ 'GROUP7') *OR (&GROUP16 *EQ +
                          'GROUP7') *OR +
                          (&GROUP12 *EQ 'GROUP7') *OR (&GROUP14 *EQ +
                          'GROUP7')) THEN(CHGVAR VAR(&GROUP7L) +
                          VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP8') *OR (&GROUP2 *EQ +
                          'GROUP8') *OR (&GROUP3 *EQ 'GROUP8') *OR +
                          (&GROUP4 *EQ 'GROUP8') *OR (&GROUP5 *EQ +
                          'GROUP8') *OR (&GROUP6 *EQ 'GROUP8') *OR +
                          (&GROUP7 *EQ 'GROUP8') *OR (&GROUP8 *EQ +
                          'GROUP8') *OR (&GROUP9 *EQ 'GROUP8') *OR +
                          (&GROUP10 *EQ 'GROUP8') *OR (&GROUP11 *EQ +
                          'GROUP8') *OR (&GROUP12 *EQ 'GROUP8') *OR +
                          (&GROUP15 *EQ 'GROUP8') *OR (&GROUP16 *EQ +
                          'GROUP8') *OR +
                          (&GROUP12 *EQ 'GROUP8') *OR (&GROUP14 *EQ +
                          'GROUP8')) THEN(CHGVAR VAR(&GROUP8L) +
                          VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP9') *OR (&GROUP2 *EQ +
                          'GROUP9') *OR (&GROUP3 *EQ 'GROUP9') *OR +
                          (&GROUP4 *EQ 'GROUP9') *OR (&GROUP5 *EQ +
                          'GROUP9') *OR (&GROUP6 *EQ 'GROUP9') *OR +
                          (&GROUP7 *EQ 'GROUP9') *OR (&GROUP8 *EQ +
                          'GROUP9') *OR (&GROUP9 *EQ 'GROUP9') *OR +
                          (&GROUP10 *EQ 'GROUP9') *OR (&GROUP11 *EQ +
                          'GROUP9') *OR (&GROUP12 *EQ 'GROUP9') *OR +
                          (&GROUP15 *EQ 'GROUP9') *OR (&GROUP16 *EQ +
                          'GROUP9') *OR +
                          (&GROUP12 *EQ 'GROUP9') *OR (&GROUP14 *EQ +
                          'GROUP9')) THEN(CHGVAR VAR(&GROUP9L) +
                          VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP10') *OR (&GROUP2 *EQ +
                          'GROUP10') *OR (&GROUP3 *EQ 'GROUP10') *OR +
                          (&GROUP4 *EQ 'GROUP10') *OR (&GROUP5 *EQ +
                          'GROUP10') *OR (&GROUP6 *EQ 'GROUP10') *OR +
                          (&GROUP7 *EQ 'GROUP10') *OR (&GROUP8 *EQ +
                          'GROUP10') *OR (&GROUP9 *EQ 'GROUP10') *OR +
                          (&GROUP10 *EQ 'GROUP10') *OR (&GROUP11 *EQ +
                          'GROUP10') *OR (&GROUP12 *EQ 'GROUP10') *OR +
                          (&GROUP15 *EQ 'GROUP10') *OR (&GROUP16 *EQ +
                          'GROUP10') *OR +
                          (&GROUP12 *EQ 'GROUP10') *OR (&GROUP14 *EQ +
                          'GROUP10')) THEN(CHGVAR VAR(&GROUP10L) +
                          VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP11') *OR (&GROUP2 *EQ +
                          'GROUP11') *OR (&GROUP3 *EQ 'GROUP11') *OR +
                          (&GROUP4 *EQ 'GROUP11') *OR (&GROUP5 *EQ +
                          'GROUP11') *OR (&GROUP6 *EQ 'GROUP11') *OR +
                          (&GROUP7 *EQ 'GROUP11') *OR (&GROUP8 *EQ +
                          'GROUP11') *OR (&GROUP9 *EQ 'GROUP11') *OR +
                          (&GROUP10 *EQ 'GROUP11') *OR (&GROUP11 *EQ +
                          'GROUP11') *OR (&GROUP12 *EQ 'GROUP11') *OR +
                          (&GROUP15 *EQ 'GROUP11') *OR (&GROUP16 *EQ +
                          'GROUP11') *OR +
                          (&GROUP12 *EQ 'GROUP11') *OR (&GROUP14 *EQ +
                          'GROUP11')) THEN(CHGVAR VAR(&GROUP11L) +
                          VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP12') *OR (&GROUP2 *EQ +
                          'GROUP12') *OR (&GROUP3 *EQ 'GROUP12') *OR +
                          (&GROUP4 *EQ 'GROUP12') *OR (&GROUP5 *EQ +
                          'GROUP12') *OR (&GROUP6 *EQ 'GROUP12') *OR +
                          (&GROUP7 *EQ 'GROUP12') *OR (&GROUP8 *EQ +
                          'GROUP12') *OR (&GROUP9 *EQ 'GROUP12') *OR +
                          (&GROUP10 *EQ 'GROUP12') *OR (&GROUP11 *EQ +
                          'GROUP12') *OR (&GROUP12 *EQ 'GROUP12') *OR +
                          (&GROUP15 *EQ 'GROUP12') *OR (&GROUP16 *EQ +
                          'GROUP12') *OR +
                          (&GROUP12 *EQ 'GROUP12') *OR (&GROUP14 *EQ +
                          'GROUP12')) THEN(CHGVAR VAR(&GROUP12L) +
                          VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP13') *OR (&GROUP2 *EQ +
                          'GROUP13') *OR (&GROUP3 *EQ 'GROUP13') *OR +
                          (&GROUP4 *EQ 'GROUP13') *OR (&GROUP5 *EQ +
                          'GROUP13') *OR (&GROUP6 *EQ 'GROUP13') *OR +
                          (&GROUP7 *EQ 'GROUP13') *OR (&GROUP8 *EQ +
                          'GROUP13') *OR (&GROUP9 *EQ 'GROUP13') *OR +
                          (&GROUP10 *EQ 'GROUP13') *OR (&GROUP11 *EQ +
                          'GROUP13') *OR (&GROUP12 *EQ 'GROUP13') *OR +
                          (&GROUP15 *EQ 'GROUP13') *OR (&GROUP16 *EQ +
                          'GROUP13') *OR +
                          (&GROUP12 *EQ 'GROUP13') *OR (&GROUP14 *EQ +
                          'GROUP13')) THEN(CHGVAR VAR(&GROUP13L) +
                          VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP14') *OR (&GROUP2 *EQ +
                          'GROUP14') *OR (&GROUP3 *EQ 'GROUP14') *OR +
                          (&GROUP4 *EQ 'GROUP14') *OR (&GROUP5 *EQ +
                          'GROUP14') *OR (&GROUP6 *EQ 'GROUP14') *OR +
                          (&GROUP7 *EQ 'GROUP14') *OR (&GROUP8 *EQ +
                          'GROUP14') *OR (&GROUP9 *EQ 'GROUP14') *OR +
                          (&GROUP10 *EQ 'GROUP14') *OR (&GROUP11 *EQ +
                          'GROUP14') *OR (&GROUP12 *EQ 'GROUP14') *OR +
                          (&GROUP15 *EQ 'GROUP14') *OR (&GROUP16 *EQ +
                          'GROUP14') *OR +
                          (&GROUP12 *EQ 'GROUP14') *OR (&GROUP14 *EQ +
                          'GROUP14')) THEN(CHGVAR VAR(&GROUP14L) +
                          VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP15') *OR (&GROUP2 *EQ +
                          'GROUP15') *OR (&GROUP3 *EQ 'GROUP15') *OR +
                          (&GROUP4 *EQ 'GROUP15') *OR (&GROUP5 *EQ +
                          'GROUP15') *OR (&GROUP6 *EQ 'GROUP15') *OR +
                          (&GROUP7 *EQ 'GROUP15') *OR (&GROUP8 *EQ +
                          'GROUP15') *OR (&GROUP9 *EQ 'GROUP15') *OR +
                          (&GROUP10 *EQ 'GROUP15') *OR (&GROUP11 *EQ +
                          'GROUP15') *OR (&GROUP12 *EQ 'GROUP15') *OR +
                          (&GROUP15 *EQ 'GROUP15') *OR (&GROUP16 *EQ +
                          'GROUP15') *OR +
                          (&GROUP12 *EQ 'GROUP15') *OR (&GROUP14 *EQ +
                          'GROUP15')) THEN(CHGVAR VAR(&GROUP15L) +
                          VALUE(&HIGH))

             IF         COND((&GROUP1 *EQ 'GROUP16') *OR (&GROUP2 *EQ +
                          'GROUP16') *OR (&GROUP3 *EQ 'GROUP16') *OR +
                          (&GROUP4 *EQ 'GROUP16') *OR (&GROUP5 *EQ +
                          'GROUP16') *OR (&GROUP6 *EQ 'GROUP16') *OR +
                          (&GROUP7 *EQ 'GROUP16') *OR (&GROUP8 *EQ +
                          'GROUP16') *OR (&GROUP9 *EQ 'GROUP16') *OR +
                          (&GROUP10 *EQ 'GROUP16') *OR (&GROUP11 *EQ +
                          'GROUP16') *OR (&GROUP12 *EQ 'GROUP16') *OR +
                          (&GROUP15 *EQ 'GROUP16') *OR (&GROUP16 *EQ +
                          'GROUP16') *OR +
                          (&GROUP12 *EQ 'GROUP16') *OR (&GROUP14 *EQ +
                          'GROUP16')) THEN(CHGVAR VAR(&GROUP16L) +
                          VALUE(&HIGH))

/***                                                                    ***/
/*** Find the name of the current group job for this signon.            ***/
/***                                                                    ***/
             IF         COND(&NBR1 *EQ &LETTER) THEN(RTVDTAARA +
                          DTAARA(POPMNU (21 10)) RTNVAR(&CURRENT))
             ELSE       CMD(IF COND(&NBR2 *EQ &LETTER) +
                          THEN(RTVDTAARA DTAARA(POPMNU (31 10)) +
                          RTNVAR(&CURRENT)))
             ELSE       CMD(IF COND(&NBR3 *EQ &LETTER) +
                          THEN(RTVDTAARA DTAARA(POPMNU (41 10)) +
                          RTNVAR(&CURRENT)))
             ELSE       CMD(IF COND(&NBR4 *EQ &LETTER) +
                          THEN(RTVDTAARA DTAARA(POPMNU (51 10)) +
                          RTNVAR(&CURRENT)))
             ELSE       CMD(IF COND(&NBR5 *EQ &LETTER) +
                          THEN(RTVDTAARA DTAARA(POPMNU (61 10)) +
                          RTNVAR(&CURRENT)))

/***                                                                    ***/
/*** Reverse image the current group job name on the menu.              ***/
/***                                                                    ***/
             IF         COND(&CURRENT *EQ 'GROUP1') THEN(CHGVAR +
                          VAR(&GROUP1L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP2') THEN(CHGVAR +
                          VAR(&GROUP2L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP3') THEN(CHGVAR +
                          VAR(&GROUP3L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP4') THEN(CHGVAR +
                          VAR(&GROUP4L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP5') THEN(CHGVAR +
                          VAR(&GROUP5L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP6') THEN(CHGVAR +
                          VAR(&GROUP6L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP7') THEN(CHGVAR +
                          VAR(&GROUP7L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP8') THEN(CHGVAR +
                          VAR(&GROUP8L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP9') THEN(CHGVAR +
                          VAR(&GROUP9L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP10') THEN(CHGVAR +
                          VAR(&GROUP10L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP11') THEN(CHGVAR +
                          VAR(&GROUP11L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP12') THEN(CHGVAR +
                          VAR(&GROUP12L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP13') THEN(CHGVAR +
                          VAR(&GROUP13L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP14') THEN(CHGVAR +
                          VAR(&GROUP14L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP15') THEN(CHGVAR +
                          VAR(&GROUP15L) VALUE(&HIREV))
             IF         COND(&CURRENT *EQ 'GROUP16') THEN(CHGVAR +
                          VAR(&GROUP16L) VALUE(&HIREV))

/***                                                                    ***/
/*** Move the highlight fields to the display.  These will change       ***/
/*** group job fields to be either hilighted or reversed, depending on  ***/
/*** if they are active, or active and current, respectively.           ***/
/***                                                                    ***/
             CHGVAR     VAR(%SST(&S1GROUPS &GROUP1S 1)) VALUE(&GROUP1L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP1E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP2S 1)) VALUE(&GROUP2L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP2E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP3S 1)) VALUE(&GROUP3L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP3E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP4S 1)) VALUE(&GROUP4L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP4E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP5S 1)) VALUE(&GROUP5L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP5E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP6S 1)) VALUE(&GROUP6L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP6E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP7S 1)) VALUE(&GROUP7L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP7E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP8S 1)) VALUE(&GROUP8L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP8E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP9S 1)) VALUE(&GROUP9L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP9E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP10S 1)) +
                          VALUE(&GROUP10L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP10E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP11S 1)) +
                          VALUE(&GROUP11L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP11E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP12S 1)) +
                          VALUE(&GROUP12L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP12E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP13S 1)) +
                          VALUE(&GROUP13L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP13E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP14S 1)) +
                          VALUE(&GROUP14L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP14E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP15S 1)) +
                          VALUE(&GROUP15L)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP15E 1)) VALUE(&NORM)
             MONMSG     MSGID(MCH0603 MCH1202)

             CHGVAR     VAR(%SST(&S1GROUPS &GROUP16S 1)) +
                          VALUE(&GROUP16L)
             MONMSG     MSGID(MCH0603 MCH1202)

/*           CHGVAR     VAR(%SST(&S1GROUPS &GROUP16E 1)) VALUE(&NORM) /* */
/*           MONMSG     MSGID(MCH0603 MCH1202)                        /* */

/***                                                                    ***/
/*** Get the current time and set the hold time (for locking terminal)  ***/
/*** to the current time.                                               ***/
/***                                                                    ***/
             RTVSYSVAL  SYSVAL(QTIME) RTNVAR(&GETTIME)
             CHGVAR     VAR(&HOLDTIME) VALUE(&GETTIME)
             CHGDTAARA  DTAARA(POPMNU (171 6)) VALUE(&HOLDTIME)

             IF         COND(&GETGROUP *EQ RET_DSPLY) THEN(GOTO +
                          CMDLBL(RET_DSPLY))

/**************************************************************************/
/*** End of subroutine GetGrpList                                       ***/
/**************************************************************************/


/**************************************************************************/
/*** SUBROUTINE: Set up the array &IN to have '1' for the function      ***/
/*** GetPFK�     key that was pressed.                                  ***/
/**************************************************************************/
GetPFK:
             CHGVAR     VAR(&IN) VALUE('00000000000000000000000')

             IF         COND(&IN02 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          2 1)) VALUE('1'))
             IF         COND(&IN03 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          3 1)) VALUE('1'))
             IF         COND(&IN04 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          4 1)) VALUE('1'))
             IF         COND(&IN05 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          5 1)) VALUE('1'))
             IF         COND(&IN06 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          6 1)) VALUE('1'))
             IF         COND(&IN07 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          7 1)) VALUE('1'))
             IF         COND(&IN08 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          8 1)) VALUE('1'))
             IF         COND(&IN09 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          9 1)) VALUE('1'))
             IF         COND(&IN10 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          10 1)) VALUE('1'))
             IF         COND(&IN11 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          11 1)) VALUE('1'))
             IF         COND(&IN12 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          12 1)) VALUE('1'))
             IF         COND(&IN13 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          13 1)) VALUE('1'))
             IF         COND(&IN14 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          14 1)) VALUE('1'))
             IF         COND(&IN15 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          15 1)) VALUE('1'))
             IF         COND(&IN16 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          16 1)) VALUE('1'))
             IF         COND(&IN17 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          17 1)) VALUE('1'))
             IF         COND(&IN18 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          18 1)) VALUE('1'))
             IF         COND(&IN19 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          19 1)) VALUE('1'))
             IF         COND(&IN20 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          20 1)) VALUE('1'))
             IF         COND(&IN21 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          21 1)) VALUE('1'))
             IF         COND(&IN22 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          22 1)) VALUE('1'))
             IF         COND(&IN23 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          23 1)) VALUE('1'))
             IF         COND(&IN24 *EQ '1') THEN(CHGVAR VAR(%SST(&IN +
                          24 1)) VALUE('1'))

             IF         COND(&RTN *EQ 'ONE') THEN(GOTO CMDLBL(ONE))
             IF         COND(&RTN *EQ 'TWO') THEN(GOTO CMDLBL(TWO))
             IF         COND(&RTN *EQ 'THREE') THEN(GOTO CMDLBL(THREE))
             IF         COND(&RTN *EQ 'FOUR') THEN(GOTO CMDLBL(FOUR))
             IF         COND(&RTN *EQ 'FKEYS') THEN(GOTO CMDLBL(FKEYS))

/**************************************************************************/
/*** End of subroutine GetPFK                                           ***/
/**************************************************************************/


/**************************************************************************/
/*** SUBROUTINE: Scan command line for ';' and, if found,               ***/
/*** ScanExec�   substring each command and run it.                     ***/
/**************************************************************************/
ScanExec:

/***                                                                    ***/
/*** See if the commands are stacked.                                   ***/
/***                                                                    ***/
             CHGVAR     VAR(&STRING) VALUE(&COMMAND)
             CHGVAR     VAR(&RESULT) VALUE(0)
             CHGVAR     VAR(&STRLEN) VALUE(999)
             CHGVAR     VAR(&PATTERN) VALUE(';')
             CHGVAR     VAR(&PATLEN) VALUE(1)
GetNext:
             CHGVAR     VAR(&STRPOS) VALUE(&RESULT + 1)
             CHGVAR     VAR(&RESULT) VALUE(0)
             CALL       PGM(QCLSCAN) PARM(&STRING &STRLEN &STRPOS +
                          &PATTERN &PATLEN &TRANSLATE &TRIM &WILD +
                          &RESULT)
/***                                                                    ***/
/*** If stacked commands, extract and execute the first one.            ***/
/***                                                                    ***/
             IF         COND(&RESULT *GT 0 *OR &STRPOS *GT 1) THEN(DO)
                CHGVAR     VAR(&COMMAND) VALUE(' ')
                CHGVAR     VAR(&LENGTH) VALUE(&RESULT - &STRPOS)
                IF         COND(&LENGTH *LT 1) THEN(CHGVAR +
                             VAR(&LENGTH) VALUE(999 - &STRPOS))
                CHGVAR     VAR(&COMMAND) VALUE(%SST(&STRING &STRPOS +
                             &LENGTH))
                SETATNPGM  PGM(&ATNPGM) SET(*ON)

                IF         COND(&COMMAND *EQ 'REFRESH') THEN(DO)
                   CHGVAR     VAR(&OLDMENU) VALUE(&CURMENU)
                   IF        COND(&CURMENU *EQ 'POPMNUX') THEN(CHGVAR +
                                 VAR(&CURMENU) VALUE('POPMNUY'))
                   ELSE      CMD(CHGVAR VAR(&CURMENU) VALUE('POPMNUX'))
                   CHGVAR     VAR(&RETURNPNT) VALUE('STACKCMD')
                   GOTO       CMDLBL(RESTART)
StackCmd:
                ENDDO

                ELSE       CMD(DO)

                   SETATNPGM  PGM(&ATNPGM) SET(*ON)
                   CALL       PGM(QCMDEXC) PARM(&COMMAND 1024)
                   MONMSG     MSGID(CPF0000)
                   SETATNPGM  PGM(&ATNPGM) SET(*OFF)
                ENDDO

                IF         COND(&RESULT *GT 0) +
                             THEN(GOTO CMDLBL(GETNEXT))
             ENDDO

             ELSE       CMD(DO)  /*** Not stacked commands              ***/

/***                                                                    ***/
/*** See if there is a substitution variable in the command.  If there  ***/
/*** is, replace it with the real deal.                                 ***/
/***                                                                    ***/
                CHGVAR     VAR(&STRING) VALUE(&COMMAND)
                CHGVAR     VAR(&RESULT) VALUE(0)
                CHGVAR     VAR(&STRLEN) VALUE(999)
                CHGVAR     VAR(&PATTERN) VALUE('&')
                CHGVAR     VAR(&PATLEN) VALUE(1)
                CHGVAR     VAR(&STRPOS) VALUE(1)
                CHGVAR     VAR(&RESULT) VALUE(0)

                CALL       PGM(QCLSCAN) PARM(&STRING &STRLEN +
                             &STRPOS &PATTERN &PATLEN &TRANSLATE +
                             &TRIM &WILD &RESULT)

                IF         COND(&RESULT *GT 1) THEN(DO)
                   CHGVAR     VAR(&STRPOS) VALUE(&RESULT + 1)
                   CHGVAR     VAR(&CMDBEG) VALUE(&RESULT)
                   CHGVAR     VAR(&RESULT) VALUE(&RESULT - 1)
                   CHGVAR     VAR(&CMD1) VALUE(%SST(&COMMAND +
                                1 &RESULT))
                   CHGVAR     VAR(&RESULT) VALUE(0)
                   CHGVAR     VAR(&PATTERN) VALUE('/')

                   CALL       PGM(QCLSCAN) PARM(&STRING &STRLEN +
                                &STRPOS &PATTERN &PATLEN +
                                &TRANSLATE &TRIM &WILD &RESULT)
                   CHGVAR     VAR(&CMDEND) VALUE(&RESULT - &CMDBEG)
                   CHGVAR     VAR(&STRPOS) VALUE(1024 - &RESULT)
                   CHGVAR     VAR(&CMD2) VALUE(%SST(&COMMAND +
                                &RESULT &STRPOS))

                   CHGVAR     VAR(&CMD3) VALUE(%SST(&COMMAND +
                                &CMDBEG &CMDEND))

                   IF        COND(&CMD3 *EQ '&UTILLIB') THEN(+
                               CHGVAR  VAR(&CMD3) VALUE(&UTILLIB))
                   CHGVAR     VAR(&COMMAND) VALUE(&CMD1 *TCAT +
                                &CMD3 *TCAT &CMD2)
                ENDDO

                SETATNPGM  PGM(&ATNPGM) SET(*ON)
                CALL       PGM(QCMDEXC) PARM(&COMMAND 1024)
                MONMSG     MSGID(CPF0000)
                SETATNPGM  PGM(&ATNPGM) SET(*OFF)
             ENDDO

             IF         COND(&RETURNPNT *EQ 'END_EXEC') THEN(GOTO +
                          CMDLBL(END_EXEC))
             IF         COND(&RETURNPNT *EQ 'STARTDAY') THEN(GOTO +
                          CMDLBL(STARTDAY))
             IF         COND(&RETURNPNT *EQ EACHTIME) THEN(GOTO +
                          CMDLBL(EACHTIME))
             GOTO       CMDLBL(DISPLAY)

/**************************************************************************/
/*** End of subroutine ScanExec                                         ***/
/**************************************************************************/

/**************************************************************************/
/*** SUBROUTINE:  Change a menu option.                                 ***/
/*** ChgMenuOpt�                                                        ***/
/**************************************************************************/
ChgMenuOpt:
             CHGVAR     VAR(&IN23) VALUE('0')
             CHGVAR     VAR(&S3NBR) VALUE(' ')
             CHGVAR     VAR(&S4TEXT) VALUE(' ')
             CHGVAR     VAR(&S4COMMAND) VALUE(' ')
             CHGVAR     VAR(&IN58) VALUE('0')
             CHGVAR     VAR(&IN59) VALUE('0')
             CHGVAR     VAR(&S3GROUP) VALUE(' ')

/***                                                                    ***/
/*** Find out whether we should show the group option.                  ***/
/***                                                                    ***/
             RTVDTAARA  DTAARA(POPMNU (301 1)) RTNVAR(&SHOWGROUP)
             IF         COND(&SHOWGROUP *EQ 'Y') THEN(CHGVAR +
                          VAR(&IN57) VALUE('1'))
             ELSE       CMD(CHGVAR VAR(&IN57) VALUE('0'))

StartChg:
/***                                                                    ***/
/*** If the group job option is enabled, find our if we are changing    ***/
/*** a group job.                                                       ***/
/***                                                                    ***/
             IF         COND(&IN57) THEN(DO)
                SNDRCVF    RCDFMT(SCRN03) WAIT(*YES)
                IF         COND(&IN12) THEN(DO)
                   CHGVAR     VAR(&SINP) VALUE('  ')
                   GOTO       CMDLBL(DISPLAY)
                ENDDO
                IF         COND(&S3GROUP *EQ 'Y') THEN(CHGVAR VAR(&IN58) +
                             VALUE('1'))
                ELSE       CMD(CHGVAR VAR(&IN59) VALUE('1'))
             ENDDO

/***                                                                    ***/
/*** Send the screen to get the option number to change.                ***/
/***                                                                    ***/
             SNDRCVF    RCDFMT(SCRN03) WAIT(*YES)
             IF         COND(&IN12) THEN(DO)
                CHGVAR     VAR(&SINP) VALUE('  ')
                GOTO       CMDLBL(DISPLAY)
             ENDDO

/***                                                                    ***/
/*** Check to see if good option number.                                ***/
/***                                                                    ***/
             IF         COND(&IN58) THEN(DO)
                IF         COND(&S3GRPOPT *LT 'A' *OR &S3GRPOPT *GT 'P') +
                             THEN(DO)
                   CHGVAR     VAR(&SINP) VALUE('  ')
                   GOTO       CMDLBL(DISPLAY)
                ENDDO       /**�If &s3GrpOpt not good      ***/
                ELSE       CMD(DO) /*** &s3GrpOpt is good ***/

/*** Change &STRING to have the function key values.                    ***/
                   CHGVAR     VAR(&STRING) VALUE(&GROUPLISTA)
                   CHGVAR     VAR(&RESULT) VALUE(0)
                   CHGVAR     VAR(&STRLEN) VALUE(16)
                   CHGVAR     VAR(&PATTERN) VALUE(&S3GRPOPT)
                   CHGVAR     VAR(&PATLEN) VALUE(1)
                   CHGVAR     VAR(&STRPOS) VALUE(1)
                   CHGVAR     VAR(&RESULT) VALUE(0)

/*** Search for a '1' in the array.                                     ***/
                   CALL       PGM(QCLSCAN) PARM(&STRING &STRLEN &STRPOS +
                                &PATTERN &PATLEN &TRANSLATE &TRIM &WILD +
                                &RESULT)
                   CHGVAR     VAR(&RESULT) VALUE(&RESULT * 2)
                   CHGVAR     VAR(&RESULT) VALUE(&RESULT - 1)
                   CHGVAR     VAR(&MSGID) VALUE('MNU99' *CAT +
                                %SST(&GROUPLIST &RESULT 2))
                ENDDO       /*** &s3GrpOpt is good.      ***/
             ENDDO

             ELSE       CMD(DO) /**�Else &IN58 is off.     ***/
                IF         COND(&S3NBR *LT '0001' *OR &S3NBR *GT '9999') +
                             THEN(DO)
                   CHGVAR     VAR(&SINP) VALUE('  ')
                   GOTO       CMDLBL(DISPLAY)
                ENDDO
                ELSE       CMD(DO)
                   CHGVAR     VAR(&S4NBR) VALUE(&SUBMENU *CAT &S3NBR)
                   CHGVAR     VAR(&MSGID) VALUE('MNU' *CAT &S4NBR)
                ENDDO
             ENDDO

/***                                                                    ***/
/*** The option number was good, now get the message data.  If the      ***/
/*** message does not exist, add the message description to the file.   ***/
/***                                                                    ***/

             RTVMSG     MSGID(&MSGID) MSGF(POPMNU) MSG(&MSGDTA) +
                          SECLVL(&TEXT2) LOGPRB(&GROUPJOB)
             CHGVAR     VAR(&TEXT1) VALUE(%SST(&MSGDTA 1 19))
             CHGVAR     VAR(&COLOR) VALUE(%SST(&MSGDTA 21 2))
             MONMSG     MSGID(CPF2419) EXEC(DO)
                ADDMSGD    MSGID(&MSGID) MSGF(POPMNU) MSG('N/A')
                CHGVAR     VAR(&TEXT1) VALUE(' ')
                CHGVAR     VAR(&TEXT2) VALUE(' ')
             ENDDO

             MONMSG     MSGID(CPF0000) EXEC(DO)
                CHGVAR     VAR(&SINP) VALUE('  ')
                GOTO       CMDLBL(DISPLAY)
             ENDDO

/***                                                                    ***/
/*** Prompt for non-group jobs...                                       ***/
/***                                                                    ***/
             CHGVAR     VAR(&RETURNPNT) VALUE('RETURNOPT')
             CHGVAR     VAR(&GRPYES) VALUE(*NO)
             IF         COND((&GROUPJOB *EQ 'N' *AND (&S3GROUP *NE +
                          'Y' *OR &S3GROUP = ' ')) *OR (&GROUPJOB = +
                          'Y' *AND &S3GROUP *NE 'Y')) THEN(GOTO +
                          CMDLBL(UPDATEOPT))

/***                                                                    ***/
/*** and group jobs.                                                    ***/
/***                                                                    ***/
             ELSE       CMD(DO)
                CHGVAR     VAR(&GRPYES) VALUE(*YES)
                GOTO       CMDLBL(UPDATEGRP)
             ENDDO
ReturnOpt:

/***                                                                    ***/
/*** Update the message text.                                           ***/
/***                                                                    ***/
             IF         COND(*NOT &IN12) THEN(DO)
                IF         COND(%SST(&TEXT2 1 5) *EQ 'GROUP') +
                             THEN(CHGVAR VAR(&TEXT1) VALUE(&S3GRPOPT +
                             *TCAT '.' *BCAT &S9TEXT))
                ELSE       CMD(CHGVAR VAR(&TEXT1) VALUE(%SST(&S3NBR 2 +
                             2) *TCAT '.' *BCAT &S4TEXT))

                IF         COND(%SST(&TEXT1 1 1) *EQ '0') THEN(CHGVAR +
                             VAR(%SST(&TEXT1 1 1)) VALUE(' '))
                CHGVAR     VAR(&TEXT2) VALUE(&S4COMMAND)
                CHGVAR     VAR(&MSGDTA) VALUE(&TEXT1 *CAT &S4COLOR)
                CHGMSGD    MSGID(&MSGID) MSGF(POPMNU) MSG(&MSGDTA) +
                             SECLVL(&TEXT2) LOGPRB(&GRPYES)
                CHGVAR     VAR(&S4COLOR) VALUE('  ')
             ENDDO

             GOTO       CMDLBL(RETURNMENU)

/**************************************************************************/
/*** End of subroutine ChgMenuOpt                                       ***/
/**************************************************************************/

/**************************************************************************/
/*** SUBROUTINE:  Update the option for non-group jobs.                 ***/
/*** UpdateOpt�                                                         ***/
/**************************************************************************/
UpdateOpt:
/***                                                                    ***/
/*** Move the message fields to the display fields.                     ***/
/***                                                                    ***/
             CHGVAR     VAR(&S4TEXT) VALUE(%SST(&TEXT1 5 14))
             CHGVAR     VAR(&S4COMMAND) VALUE(&TEXT2)
             CHGVAR     VAR(&S4COLOR) VALUE(&COLOR)
             CHGVAR     VAR(&IN23) VALUE('1')

/***                                                                    ***/
/*** Prompt with the message on the display except if F10 is pressed.   ***/
/*** F10 allows by-passing the prompt in order for multiple commands    ***/
/*** to be entered.                                                     ***/
/***                                                                    ***/
Send_04:
             SNDRCVF    RCDFMT(SCRN04) WAIT(*YES)
             IF         COND(&IN04) THEN(DO)
                SNDRCVF    RCDFMT(SCRN17)
                GOTO       CMDLBL(SEND_04)
             ENDDO

             IF         COND(&IN12 *OR &IN10) THEN(GOTO +
                          CMDLBL(SKIPPRMPT))
             GOTO       CMDLBL(PRMPTSTACK)
SingleStrt:
             CHGVAR     VAR(&TEXT2) VALUE('?' *CAT &S4COMMAND)
             CHGVAR     VAR(&CMDLEN) VALUE(1024)
             CALL       PGM(QCMDCHK) PARM(&TEXT2 &CMDLEN)

             CHGVAR     VAR(&S4COMMAND) VALUE(&TEXT2)

EndMulti:
             SNDRCVF    RCDFMT(SCRN04) WAIT(*YES)

SkipPrmpt:
             IF         COND(&RETURNPNT = 'RETURNOPT') THEN(GOTO +
                          CMDLBL(RETURNOPT))
             IF         COND(&RETURNPNT = 'RETURNCMD') THEN(GOTO +
                          CMDLBL(RETURNCMD))

/**************************************************************************/
/*** End of subroutine UpdateOpt                                        ***/
/**************************************************************************/

/**************************************************************************/
/*** SUBROUTINE:  Prompt for stacked commands.                          ***/
/*** PrmptStack                                                         ***/
/**************************************************************************/
PrmptStack:

             CHGVAR     VAR(&TEXT3) VALUE(' ')
/***                                                                    ***/
/*** See if the commands are stacked.                                   ***/
/***                                                                    ***/
             CHGVAR     VAR(&STRING) VALUE(&S4COMMAND)
             CHGVAR     VAR(&RESULT) VALUE(0)
             CHGVAR     VAR(&STRLEN) VALUE(999)
             CHGVAR     VAR(&PATTERN) VALUE(';')
             CHGVAR     VAR(&PATLEN) VALUE(1)
GetNextP:
             CHGVAR     VAR(&STRPOS) VALUE(&RESULT + 1)
             CHGVAR     VAR(&RESULT) VALUE(0)
             CALL       PGM(QCLSCAN) PARM(&STRING &STRLEN &STRPOS +
                          &PATTERN &PATLEN &TRANSLATE &TRIM &WILD +
                          &RESULT)
/***                                                                    ***/
/*** If stacked commands, extract and verify the first one.             ***/
/***                                                                    ***/
             IF         COND(&RESULT *GT 0 *OR &STRPOS *GT 1) THEN(DO)
                CHGVAR     VAR(&COMMAND) VALUE(' ')
                CHGVAR     VAR(&LENGTH) VALUE(&RESULT - &STRPOS)
                IF         COND(&LENGTH *LT 1) THEN(CHGVAR +
                             VAR(&LENGTH) VALUE(999 - &STRPOS))

                /*** Get the command from the original stack.           ***/
                CHGVAR     VAR(&TEXT2) VALUE('?' *TCAT %SST(&STRING +
                             &STRPOS &LENGTH))
                CHGVAR     VAR(&CMDLEN) VALUE(1024)
                CALL       PGM(QCMDCHK) PARM(&TEXT2 &CMDLEN)

                /*** Save the command stack in a new stack.             ***/
                CHGVAR     VAR(&TEXT3) VALUE(&TEXT3 *TCAT ';' *TCAT +
                             &TEXT2)
                IF         COND(&RESULT *GT 0) THEN(GOTO +
                             CMDLBL(GETNEXTP))
             ENDDO

/***                                                                    ***/
/*** If the result is zero and the starting position is zero then       ***/
/*** this is not a stacked command.                                     ***/
/***                                                                    ***/
             ELSE       CMD(GOTO CMDLBL(SINGLESTRT))

/***                                                                    ***/
/*** End of stacked commands.                                           ***/
/***                                                                    ***/
             IF         COND(%SST(&TEXT3 1 1) *EQ ';') THEN(CHGVAR +
                          VAR(&S4COMMAND) VALUE(%SST(&TEXT3 2 1023)))
             ELSE       CMD(CHGVAR VAR(&S4COMMAND) VALUE(&TEXT3))

             GOTO       CMDLBL(ENDMULTI)

/**************************************************************************/
/*** End of subroutine PrmptStack                                       ***/
/**************************************************************************/


/**************************************************************************/
/*** SUBROUTINE:  Update the option for group jobs.                     ***/
/*** UpdateGrp�                                                         ***/
/**************************************************************************/
UpdateGrp:

/***                                                                    ***/
/*** Move the fields to the display.                                    ***/
/***                                                                    ***/
             CHGVAR     VAR(&S9TEXT) VALUE(%SST(&TEXT1 4 17))
             CHGVAR     VAR(&S9GRPNAME) VALUE(%SST(&TEXT2 1 10))

/***                                                                    ***/
/*** If the group name is blank then set it correctly.                  ***/
/***                                                                    ***/
             IF         COND(&S9GRPNAME *EQ ' ') THEN(DO)
                IF (&S3GRPOPT *EQ 'A') CHGVAR &S9GRPNAME 'GROUP1'
                IF (&S3GRPOPT *EQ 'B') CHGVAR &S9GRPNAME 'GROUP2'
                IF (&S3GRPOPT *EQ 'C') CHGVAR &S9GRPNAME 'GROUP3'
                IF (&S3GRPOPT *EQ 'D') CHGVAR &S9GRPNAME 'GROUP4'
                IF (&S3GRPOPT *EQ 'E') CHGVAR &S9GRPNAME 'GROUP5'
                IF (&S3GRPOPT *EQ 'F') CHGVAR &S9GRPNAME 'GROUP6'
                IF (&S3GRPOPT *EQ 'G') CHGVAR &S9GRPNAME 'GROUP7'
                IF (&S3GRPOPT *EQ 'H') CHGVAR &S9GRPNAME 'GROUP8'
                IF (&S3GRPOPT *EQ 'I') CHGVAR &S9GRPNAME 'GROUP9'
                IF (&S3GRPOPT *EQ 'J') CHGVAR &S9GRPNAME 'GROUP10'
                IF (&S3GRPOPT *EQ 'K') CHGVAR &S9GRPNAME 'GROUP11'
                IF (&S3GRPOPT *EQ 'L') CHGVAR &S9GRPNAME 'GROUP12'
                IF (&S3GRPOPT *EQ 'M') CHGVAR &S9GRPNAME 'GROUP13'
                IF (&S3GRPOPT *EQ 'N') CHGVAR &S9GRPNAME 'GROUP14'
                IF (&S3GRPOPT *EQ 'O') CHGVAR &S9GRPNAME 'GROUP15'
                IF (&S3GRPOPT *EQ 'P') CHGVAR &S9GRPNAME 'GROUP16'
             ENDDO

/***                                                                    ***/
/*** Load the rest of the fields.                                       ***/
/***                                                                    ***/
             CHGVAR     VAR(&S9GRPTEXT) VALUE(%SST(&TEXT2 11 50))
             CHGVAR     VAR(&S9GRPPROG) VALUE(%SST(&TEXT2 61 10))
             CHGVAR     VAR(&S9GRPHIBEG) VALUE(%SST(&TEXT2 71 4))
             CHGVAR     VAR(&S9GRPHIEND) VALUE(%SST(&TEXT2 75 4))

/***                                                                    ***/
/*** If the start and end positions for the group job hilights are      ***/
/*** blank then calculate them and fill them in in the window.          ***/
/***                                                                    ***/
             IF         COND((%SST(&TEXT2 71 8)) *EQ ' ') THEN(DO)
               CHGVAR     VAR(&HIPOS) VALUE(&S3NBR)
               IF         COND(&HIPOS *LE 20) THEN(+
               CHGVAR     VAR(&HIPOS) VALUE(((&HIPOS - 1) * 80) + 1))
               ELSE       CMD(IF COND(&HIPOS *GE 21 *AND &HIPOS *LE +
                            40) THEN(+
               CHGVAR     VAR(&HIPOS) VALUE(((&HIPOS - 21) * 80) +20)))

               ELSE       CMD(IF COND(&HIPOS *GE 41 *AND &HIPOS *LE +
                            60) THEN(DO))
               CHGVAR    VAR(&HIPOS) VALUE(((&HIPOS - 41) * 80) + 39)
               ENDDO

               ELSE       CMD(IF COND(&HIPOS *GE 61 *AND &HIPOS *LE +
                            80) THEN(+
               CHGVAR    VAR(&HIPOS) VALUE(((&HIPOS - 61) * 80) + 58)))

               CHGVAR     VAR(&S9GRPHIBEG) VALUE(&HIPOS)
               CHGVAR     VAR(&HIPOS) VALUE(&HIPOS +19)
               CHGVAR     VAR(&S9GRPHIEND) VALUE(&HIPOS)
             ENDDO

             SNDRCVF    RCDFMT(SCRN09)
             IF         COND(*NOT &IN12) THEN(DO)
                CHGVAR     VAR(&TEXT2) VALUE(' ')
                CHGVAR     VAR(%SST(&TEXT2 1 10)) VALUE(&S9GRPNAME)
                CHGVAR     VAR(%SST(&TEXT2 11 50)) VALUE(&S9GRPTEXT)
                CHGVAR     VAR(%SST(&TEXT2 61 10)) VALUE(&S9GRPPROG)
                CHGVAR     VAR(%SST(&TEXT2 71 4)) VALUE(&S9GRPHIBEG)
                CHGVAR     VAR(%SST(&TEXT2 75 4)) VALUE(&S9GRPHIEND)

                CHGVAR     VAR(&S4COMMAND) VALUE(&TEXT2)
             ENDDO

             GOTO       CMDLBL(RETURNOPT)

/**************************************************************************/
/*** End of subroutine UpdateGrp                                        ***/
/**************************************************************************/


/**************************************************************************/
/*** SUBROUTINE:  Display and allow changes to the function keys.       ***/
/*** EditFKeys�                                                         ***/
/**************************************************************************/
EditFKeys:
/***                                                                    ***/
/*** Load the values of the function keys into the display.             ***/
/***                                                                    ***/
             RTVMSG     MSGID(MNU0301) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT1) VALUE(' ')
             CHGVAR     VAR(&@FUNCT1) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0302) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT2) VALUE(' ')
             CHGVAR     VAR(&@FUNCT2) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0303) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT3) VALUE(' ')
             CHGVAR     VAR(&@FUNCT3) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0304) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT4) VALUE(' ')
             CHGVAR     VAR(&@FUNCT4) VALUE(%SST(&FCMD 1 30))

             RTVMSG     MSGID(MNU0305) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT5) VALUE(' ')
             CHGVAR     VAR(&@FUNCT5) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0306) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT6) VALUE(' ')
             CHGVAR     VAR(&@FUNCT6) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0307) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT7) VALUE(' ')
             CHGVAR     VAR(&@FUNCT7) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0308) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT8) VALUE(' ')
             CHGVAR     VAR(&@FUNCT8) VALUE(%SST(&FCMD 1 30))

             RTVMSG     MSGID(MNU0309) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT9) VALUE(' ')
             CHGVAR     VAR(&@FUNCT9) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0310) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT10) VALUE(' ')
             CHGVAR     VAR(&@FUNCT10) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0311) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT11) VALUE(' ')
             CHGVAR     VAR(&@FUNCT11) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0312) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT12) VALUE(' ')
             CHGVAR     VAR(&@FUNCT12) VALUE(%SST(&FCMD 1 30))

             RTVMSG     MSGID(MNU0313) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT13) VALUE(' ')
             CHGVAR     VAR(&@FUNCT13) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0314) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT14) VALUE(' ')
             CHGVAR     VAR(&@FUNCT14) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0315) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT15) VALUE(' ')
             CHGVAR     VAR(&@FUNCT15) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0316) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT16) VALUE(' ')
             CHGVAR     VAR(&@FUNCT16) VALUE(%SST(&FCMD 1 30))

             RTVMSG     MSGID(MNU0317) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT17) VALUE(' ')
             CHGVAR     VAR(&@FUNCT17) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0318) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT18) VALUE(' ')
             CHGVAR     VAR(&@FUNCT18) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0319) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT19) VALUE(' ')
             CHGVAR     VAR(&@FUNCT19) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0320) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT20) VALUE(' ')
             CHGVAR     VAR(&@FUNCT20) VALUE(%SST(&FCMD 1 30))

             RTVMSG     MSGID(MNU0321) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT21) VALUE(' ')
             CHGVAR     VAR(&@FUNCT21) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0322) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT22) VALUE(' ')
             CHGVAR     VAR(&@FUNCT22) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0323) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT23) VALUE(' ')
             CHGVAR     VAR(&@FUNCT23) VALUE(%SST(&FCMD 1 30))
             RTVMSG     MSGID(MNU0324) MSGF(POPMNU) MSG(&FKEY) +
                          SECLVL(&FCMD)
             CHGVAR     VAR(&@OPT24) VALUE(' ')
             CHGVAR     VAR(&@FUNCT24) VALUE(%SST(&FCMD 1 30))

/***                                                                    ***/
/*** Show the display screen.                                           ***/
/***                                                                    ***/
DisplayFK:
             SNDRCVF    RCDFMT(SCRN10)
             IF         COND(&IN12) THEN(GOTO CMDLBL(SNDF))

             IF         COND(&@OPT1 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0301')
                CHGVAR     VAR(&S12FKEY) VALUE('F01')
                CHGVAR     VAR(&@OPT1) VALUE(' ')
             ENDDO

             IF         COND(&@OPT2 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0302')
                CHGVAR     VAR(&S12FKEY) VALUE('F02')
                CHGVAR     VAR(&@OPT2) VALUE(' ')
             ENDDO

             IF         COND(&@OPT3 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0303')
                CHGVAR     VAR(&S12FKEY) VALUE('F03')
                CHGVAR     VAR(&@OPT3) VALUE(' ')
             ENDDO

             IF         COND(&@OPT4 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0304')
                CHGVAR     VAR(&S12FKEY) VALUE('F04')
                CHGVAR     VAR(&@OPT4) VALUE(' ')
             ENDDO

             IF         COND(&@OPT5 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0305')
                CHGVAR     VAR(&S12FKEY) VALUE('F05')
                CHGVAR     VAR(&@OPT5) VALUE(' ')
             ENDDO

             IF         COND(&@OPT6 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0306')
                CHGVAR     VAR(&S12FKEY) VALUE('F06')
                CHGVAR     VAR(&@OPT6) VALUE(' ')
             ENDDO

             IF         COND(&@OPT7 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0307')
                CHGVAR     VAR(&S12FKEY) VALUE('F07')
                CHGVAR     VAR(&@OPT7) VALUE(' ')
             ENDDO

             IF         COND(&@OPT8 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0308')
                CHGVAR     VAR(&S12FKEY) VALUE('F08')
                CHGVAR     VAR(&@OPT8) VALUE(' ')
             ENDDO

             IF         COND(&@OPT9 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0309')
                CHGVAR     VAR(&S12FKEY) VALUE('F09')
                CHGVAR     VAR(&@OPT9) VALUE(' ')
             ENDDO

             IF         COND(&@OPT10 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0310')
                CHGVAR     VAR(&S12FKEY) VALUE('F10')
                CHGVAR     VAR(&@OPT10) VALUE(' ')
             ENDDO

             IF         COND(&@OPT11 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0311')
                CHGVAR     VAR(&S12FKEY) VALUE('F11')
                CHGVAR     VAR(&@OPT11) VALUE(' ')
             ENDDO

             IF         COND(&@OPT12 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0312')
                CHGVAR     VAR(&S12FKEY) VALUE('F12')
                CHGVAR     VAR(&@OPT12) VALUE(' ')
             ENDDO

             IF         COND(&@OPT13 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0313')
                CHGVAR     VAR(&S12FKEY) VALUE('F13')
                CHGVAR     VAR(&@OPT13) VALUE(' ')
             ENDDO

             IF         COND(&@OPT14 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0314')
                CHGVAR     VAR(&S12FKEY) VALUE('F14')
                CHGVAR     VAR(&@OPT14) VALUE(' ')
             ENDDO

             IF         COND(&@OPT15 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0315')
                CHGVAR     VAR(&S12FKEY) VALUE('F15')
                CHGVAR     VAR(&@OPT15) VALUE(' ')
             ENDDO

             IF         COND(&@OPT16 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0316')
                CHGVAR     VAR(&S12FKEY) VALUE('F16')
                CHGVAR     VAR(&@OPT16) VALUE(' ')
             ENDDO

             IF         COND(&@OPT17 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0317')
                CHGVAR     VAR(&S12FKEY) VALUE('F17')
                CHGVAR     VAR(&@OPT17) VALUE(' ')
             ENDDO

             IF         COND(&@OPT18 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0318')
                CHGVAR     VAR(&S12FKEY) VALUE('F18')
                CHGVAR     VAR(&@OPT18) VALUE(' ')
             ENDDO

             IF         COND(&@OPT19 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0319')
                CHGVAR     VAR(&S12FKEY) VALUE('F19')
                CHGVAR     VAR(&@OPT19) VALUE(' ')
             ENDDO

             IF         COND(&@OPT20 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0320')
                CHGVAR     VAR(&S12FKEY) VALUE('F20')
                CHGVAR     VAR(&@OPT20) VALUE(' ')
             ENDDO

             IF         COND(&@OPT21 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0321')
                CHGVAR     VAR(&S12FKEY) VALUE('F21')
                CHGVAR     VAR(&@OPT21) VALUE(' ')
             ENDDO

             IF         COND(&@OPT22 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0322')
                CHGVAR     VAR(&S12FKEY) VALUE('F22')
                CHGVAR     VAR(&@OPT22) VALUE(' ')
             ENDDO

             IF         COND(&@OPT23 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0323')
                CHGVAR     VAR(&S12FKEY) VALUE('F23')
                CHGVAR     VAR(&@OPT23) VALUE(' ')
             ENDDO

             IF         COND(&@OPT24 = '2') THEN(DO)
                CHGVAR &MSGID ('MNU0324')
                CHGVAR     VAR(&S12FKEY) VALUE('F24')
                CHGVAR     VAR(&@OPT24) VALUE(' ')
             ENDDO

             RTVMSG     MSGID(&MSGID) MSGF(POPMNU) MSG(&TEXT1) +
                          SECLVL(&TEXT2)

             CHGVAR     VAR(&RETURNPNT) VALUE('RETURNCMD')
             GOTO       CMDLBL(UPDATEOPT)
ReturnCmd:

/***                                                                    ***/
/*** Update the message text.                                           ***/
/***                                                                    ***/
             IF         COND(*NOT &IN12) THEN(DO)
                CHGVAR     VAR(&TEXT2) VALUE(&S4COMMAND)
                CHGMSGD    MSGID(&MSGID) MSGF(POPMNU) SECLVL(&TEXT2)
                GOTO       CMDLBL(EDITFKEYS)
             ENDDO

             GOTO       CMDLBL(DISPLAYFK)

/**************************************************************************/
/*** End of subroutine EditFKeys                                        ***/
/**************************************************************************/


/**************************************************************************/
/*** SUBROUTINE: Lock the display and gather the password               ***/
/**************************************************************************/

/***                                                                    ***/
/*** Retrieve the function keys for unlocking the terminal.             ***/
/***                                                                    ***/
Secure1:
             CHGDTAARA  DTAARA(POPLOCK) VALUE('Y')
             RTVDTAARA  DTAARA(POPMNU (193 2)) RTNVAR(&ONE)
             RTVDTAARA  DTAARA(POPMNU (195 2)) RTNVAR(&TWO)
             RTVDTAARA  DTAARA(POPMNU (197 2)) RTNVAR(&THREE)
             RTVDTAARA  DTAARA(POPMNU (199 2)) RTNVAR(&FOUR)

             CHGVAR     VAR(&@ONE) VALUE(&ONE)
             CHGVAR     VAR(&@TWO) VALUE(&TWO)
             CHGVAR     VAR(&@THREE) VALUE(&THREE)
             CHGVAR     VAR(&@FOUR) VALUE(&FOUR)

/***                                                                    ***/
/*** Set the attention program off, change the message queue to hold,   ***/
/*** and change the menu variable to show that the display is locked.   ***/
/***                                                                    ***/
             CHGVAR     VAR(&SINP) VALUE('  ')
             SETATNPGM  PGM(*CURRENT) SET(*OFF)
             CHGMSGQ    MSGQ(&USRPRF) DLVRY(*HOLD)
             CHGMSGQ    MSGQ(&JOB) DLVRY(*HOLD)
             CHGMSGQ    MSGQ(QTEMP/Q) DLVRY(*HOLD)
             CHGVAR     VAR(&S1CURLIB) VALUE('**LOCKED**')
             CHGVAR     VAR(&IN97) VALUE('1')

/***                                                                    ***/
/*** Display the current time on the display and show the display.      ***/
/***                                                                    ***/
Sndf1:
             RTVSYSVAL  SYSVAL(QHOUR) RTNVAR(&HOUR)
             RTVSYSVAL  SYSVAL(QMINUTE) RTNVAR(&MINUTE)
             RTVSYSVAL  SYSVAL(QSECOND) RTNVAR(&SECOND)
             CHGVAR     VAR(&S1TIME) VALUE(&HOUR *CAT ':' *CAT +
                          &MINUTE *CAT ':' *CAT &SECOND)
             SNDRCVF    RCDFMT(SCRN01) WAIT(*NO)
             WAIT
/***                                                                    ***/
/*** Monitor for a timeout on the display, just loop when it happens.   ***/
/*** Also, see if another session has unlocked the display.             ***/
/***                                                                    ***/
             MONMSG     MSGID(CPF0887) EXEC(DO)
                RCVMSG     PGMQ(*SAME (*)) MSGQ(*PGMQ) MSGTYPE(*EXCP)
                GOTO       CMDLBL(SNDF1)
             ENDDO
             MONMSG     MSGID(CPF0889) EXEC(DO)
                RCVMSG     PGMQ(*SAME (*)) MSGQ(*PGMQ) MSGTYPE(*EXCP)
                RTVDTAARA  DTAARA(POPLOCK) RTNVAR(&POPLOCK)
                IF         COND(&POPLOCK *EQ ' ') THEN(GOTO +
                             CMDLBL(ENDSECURE))
                GOTO       CMDLBL(SNDF1)
             ENDDO

             MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(SNDF1))

/***                                                                    ***/
/*** See if the dislay has been unlocked by another session.            ***/
/***                                                                    ***/
             RTVDTAARA  DTAARA(POPLOCK) RTNVAR(&POPLOCK)
             IF         COND(&POPLOCK *EQ ' ') THEN(GOTO +
                          CMDLBL(ENDSECURE))

/***                                                                    ***/
/*** If help is pressed, show the help screen.                          ***/
/***                                                                    ***/
             IF         COND(&IN98) THEN(DO)
                SNDRCVF    RCDFMT(SCRN02)
                GOTO       CMDLBL(SNDF1)
             ENDDO

/***                                                                    ***/
/*** If F23 was pressed, signoff.  If F22 was pressed, disconnect       ***/
/*** the job.  If "99" was entered, signoff.                            ***/
/***                                                                    ***/
             IF         COND(&SINP *EQ '99') THEN(DO)
                IF         COND(&NBR1 *EQ &LETTER) THEN(CHGDTAARA +
                             DTAARA(POPMNU (101 2)) VALUE('  '))
                ELSE       CMD(IF COND(&NBR2 *EQ &LETTER) +
                             THEN(CHGDTAARA DTAARA(POPMNU (103 2)) +
                             VALUE('  ')))
                ELSE       CMD(IF COND(&NBR3 *EQ &LETTER) +
                             THEN(CHGDTAARA DTAARA(POPMNU (105 2)) +
                             VALUE('  ')))
                ELSE       CMD(IF COND(&NBR4 *EQ &LETTER) +
                             THEN(CHGDTAARA DTAARA(POPMNU (107 2)) +
                             VALUE('  ')))
                ELSE       CMD(IF COND(&NBR5 *EQ &LETTER) +
                             THEN(CHGDTAARA DTAARA(POPMNU (109 2)) +
                             VALUE('  ')))
                SIGNOFF
             ENDDO

/***                                                                    ***/
/*** For each function key pressed, execute the subroutine GETPFK,      ***/
/*** which changes the array &IN to just have the pressed function key  ***/
/*** as "1", all others as "0".  Validate that against the value, each  ***/
/*** by turn, of the keys required.  If one does not match, return to   ***/
/*** the send to start over.                                            ***/
/***                                                                    ***/
PWord:
/***                                                                    ***/
/*** Check the first value.                                             ***/
/***                                                                    ***/
             CHGVAR     VAR(&RTN) VALUE('ONE')
             GOTO       CMDLBL(GETPFK) /*�Get the PFKey pressed�*/
One:         IF         COND(%SST(&IN &@ONE 1) *EQ '0') THEN(GOTO +
                          CMDLBL(SECURE1))
             CHGVAR     VAR(&SINP) VALUE('  ')

             SNDRCVF    RCDFMT(SCRN01)

             IF         COND(&IN98) THEN(DO)
                SNDRCVF    RCDFMT(SCRN02)
                GOTO       CMDLBL(SNDF1)
             ENDDO

/***                                                                    ***/
/*** Check the second value.                                            ***/
/***                                                                    ***/
             CHGVAR     VAR(&RTN) VALUE('TWO')
             GOTO       CMDLBL(GETPFK)
Two:         IF         COND(%SST(&IN &@TWO 1) *EQ '0') THEN(GOTO +
                          CMDLBL(SECURE1))
             CHGVAR     VAR(&SINP) VALUE('  ')
             SNDRCVF    RCDFMT(SCRN01)

             IF         COND(&IN98) THEN(DO)
                SNDRCVF    RCDFMT(SCRN02)
                GOTO       CMDLBL(SNDF1)
             ENDDO

/***                                                                    ***/
/*** Check the third value.                                             ***/
/***                                                                    ***/
             CHGVAR     VAR(&RTN) VALUE('THREE')
             GOTO       CMDLBL(GETPFK)
Three:       IF         COND(%SST(&IN &@THREE 1) *EQ '0') THEN(GOTO +
                          CMDLBL(SECURE1))
             CHGVAR     VAR(&SINP) VALUE('  ')

             SNDRCVF    RCDFMT(SCRN01)

             IF         COND(&IN98) THEN(DO)
                SNDRCVF    RCDFMT(SCRN02)
                GOTO       CMDLBL(SNDF1)
             ENDDO

/***                                                                    ***/
/*** Check the fourth value.                                            ***/
/***                                                                    ***/
             CHGVAR     VAR(&RTN) VALUE('FOUR')
             GOTO       CMDLBL(GETPFK)
Four:        IF         COND(%SST(&IN &@FOUR 1) *EQ '0') THEN(GOTO +
                          CMDLBL(SECURE1))

/***                                                                    ***/
/*** Reset the attention program, message queues, etc.                  ***/
/***                                                                    ***/
EndSecure:
             CHGDTAARA  DTAARA(POPLOCK) VALUE(' ')
             CHGVAR     VAR(&PARM1) VALUE('*YES')
             SETATNPGM  PGM(*CURRENT) SET(*ON)
             CHGMSGQ    MSGQ(&USRPRF) DLVRY(*BREAK)
             CHGMSGQ    MSGQ(&JOB) DLVRY(*BREAK)
             CHGMSGQ    MSGQ(QTEMP/Q) DLVRY(*BREAK) PGM(EXCMD)
             CHGVAR     VAR(&S1CURLIB) VALUE(&CURLIB)
             CHGVAR     VAR(&IN97) VALUE('0')

/***                                                                    ***/
/*** Clear the password key variables.                                  ***/
/***                                                                    ***/
             CHGVAR     VAR(&ONE) VALUE('  ')
             CHGVAR     VAR(&TWO) VALUE('  ')
             CHGVAR     VAR(&THREE) VALUE('  ')
             CHGVAR     VAR(&FOUR) VALUE('  ')

             CHGVAR     VAR(&@ONE) VALUE(0)
             CHGVAR     VAR(&@TWO) VALUE(0)
             CHGVAR     VAR(&@THREE) VALUE(0)
             CHGVAR     VAR(&@FOUR) VALUE(0)

/***                                                                    ***/
/*** Reset the time before automatically locking the terminal.          ***/
/***                                                                    ***/
             RTVSYSVAL  SYSVAL(QTIME) RTNVAR(&GETTIME)
             CHGVAR     VAR(&HOLDTIME1) VALUE(&GETTIME)
             CHGVAR     VAR(&HOLDTIME) VALUE(&GETTIME)
             CHGVAR     VAR(&ELAPSED) VALUE(0)
             CHGDTAARA  DTAARA(POPMNU (171 6)) VALUE(&HOLDTIME)

             IF         COND(&RETURNPNT *EQ 'OPTION95') THEN(GOTO +
                          CMDLBL(OPTION95))
             IF         COND(&RETURNPNT *EQ 'DISPLAY') THEN(GOTO +
                          CMDLBL(DISPLAY))

/**************************************************************************/
/*** End of terminal lock.                                              ***/
/**************************************************************************/

/**************************************************************************/
/*** SUBROUTINE: Get all of the group jobs that are defined and show    ***/
/*** the list.                                                          ***/
/**************************************************************************/
GetDefGrp:

/*** Read through the messages from 81 to 96, setting the groups found. ***/
             CHGVAR     VAR(&SUB) VALUE(&SUB + 1)
             IF         COND(&SUB *GT 96) THEN(GOTO CMDLBL(SHOWDEFGRP))
             CHGVAR     VAR(&LETTER) VALUE(&SUB)
             CHGVAR     VAR(&MSGID) VALUE('MNU99' *CAT &LETTER)
             RTVMSG     MSGID(&MSGID) MSGF(POPMNU) SECLVL(&COMMAND)

/*** Set the appropriate group value.                                   ***/
             IF         COND(%SST(&COMMAND 6 2) *EQ '1 ') THEN(DO)
                CHGVAR     VAR(&S15GRP1) VALUE('*')
                CHGVAR     VAR(&S15GRPD1) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN41) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '2 ') THEN(DO)
                CHGVAR     VAR(&S15GRP2) VALUE('*')
                CHGVAR     VAR(&S15GRPD2) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN42) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '3 ') THEN(DO)
                CHGVAR     VAR(&S15GRP3) VALUE('*')
                CHGVAR     VAR(&S15GRPD3) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN43) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '4 ') THEN(DO)
                CHGVAR     VAR(&S15GRP4) VALUE('*')
                CHGVAR     VAR(&S15GRPD4) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN44) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '5 ') THEN(DO)
                CHGVAR     VAR(&S15GRP5) VALUE('*')
                CHGVAR     VAR(&S15GRPD5) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN45) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '6 ') THEN(DO)
                CHGVAR     VAR(&S15GRP6) VALUE('*')
                CHGVAR     VAR(&S15GRPD6) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN46) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '7 ') THEN(DO)
                CHGVAR     VAR(&S15GRP7) VALUE('*')
                CHGVAR     VAR(&S15GRPD7) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN47) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '8 ') THEN(DO)
                CHGVAR     VAR(&S15GRP8) VALUE('*')
                CHGVAR     VAR(&S15GRPD8) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN48) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '9 ') THEN(DO)
                CHGVAR     VAR(&S15GRP9) VALUE('*')
                CHGVAR     VAR(&S15GRPD9) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN49) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '10') THEN(DO)
                CHGVAR     VAR(&S15GRP10) VALUE('*')
                CHGVAR     VAR(&S15GRPD10) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN50) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '11') THEN(DO)
                CHGVAR     VAR(&S15GRP11) VALUE('*')
                CHGVAR     VAR(&S15GRPD11) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN51) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '12') THEN(DO)
                CHGVAR     VAR(&S15GRP12) VALUE('*')
                CHGVAR     VAR(&S15GRPD12) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN52) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '13') THEN(DO)
                CHGVAR     VAR(&S15GRP13) VALUE('*')
                CHGVAR     VAR(&S15GRPD13) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN53) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '14') THEN(DO)
                CHGVAR     VAR(&S15GRP14) VALUE('*')
                CHGVAR     VAR(&S15GRPD14) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN54) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '15') THEN(DO)
                CHGVAR     VAR(&S15GRP15) VALUE('*')
                CHGVAR     VAR(&S15GRPD15) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN55) VALUE('0')
             ENDDO

             IF         COND(%SST(&COMMAND 6 2) *EQ '16') THEN(DO)
                CHGVAR     VAR(&S15GRP16) VALUE('*')
                CHGVAR     VAR(&S15GRPD16) VALUE(%SST(&COMMAND 11 20))
                CHGVAR     VAR(&IN56) VALUE('0')
             ENDDO

/*** Get the next option.                                               ***/
             GOTO       CMDLBL(GETDEFGRP)

/*** Show the defined group jobs.                                       ***/
ShowDefGrp:
             SNDRCVF    RCDFMT(SCRN15)
             CHGVAR     VAR(&SINP) VALUE(' ')
             GOTO       CMDLBL(RESTART)

/**************************************************************************/
/*** End of Show Defined Groups                                         ***/
/**************************************************************************/


/**************************************************************************/
/*** END OF PROGRAM                                                     ***/
/**************************************************************************/

Endpgm:
             CHGGRPA    GRPJOB(*NONE)
             MONMSG     MSGID(CPF0000)
 ENDPGM