Booth Martin; Contract 
Programming, Inc.
28 Delmont Avenue
Barre, Vermont 05641
802-476-7942
boothm@ibm.net


Push Button Menu (Printer choices)
AS/400 session displaying a Push Button menu for Printer choices

A simple Menu with Pushbuttons


The DDS for the screen shown

     A*%%TS  SD  19980504  113753  BOOTH       REL-V4R2M0  5769-PW1
     A*%%EC
     A                                      DSPSIZ(24 80 *DS3)
     A                                      CSRINPONLY
     A                                      ERRSFL
     A*
     A          R FMT01
     A*%%TS  SD  19980504  113753  BOOTH       REL-V4R2M0  5769-PW1
     A                                      TEXT('PRINTER CONTROL MENU')
     A                                      CA03(03 'EXIT')
     A                                      CA06(06 'MESSAGE')
     A                                      BLINK
     A                                      OVERLAY
     A                                      WINDOW(4 34 10 28)
     A                                      WDWTITLE((*TEXT ' Printer Control M-
     A                                      enu'))
     A                                  2  1'Printer'
     A            FIELDP        10A  B  2  9DSPATR(UL)
     A            F2             2Y 0B  4  1PSHBTNFLD((*NUMCOL 1))
     A                                      PSHBTNCHC(1 'Start Print >Writer   -
     A                                         ' ENTER)
     A                                      PSHBTNCHC(2 'Display Output >Queue -
     A                                         ' ENTER)
     A                                      PSHBTNCHC(3 'Display >Printer Messa-
     A                                      ges' ENTER)
     A                                      PSHBTNCHC(4 'Display >Spool File   -    
     A                                         ' ENTER)
     A            F1             2Y 0B  9  2PSHBTNFLD
     A                                      PSHBTNCHC(1 '>Exit' CF03)
     A                                      PSHBTNCHC(2 '>Messages' CF06)
     A          R DUMMY
     A                                      TEXT('PREVENTS PREVIOUS SCREEN FROM-
     A                                       BEING CLEARED')
     A                                      ASSUME
     A                                  5  9' '

Top of page



The CL for the screen shown

   PGM
             DCLF       FILE(P1P0FM)
             DCL        VAR(&USER) TYPE(*CHAR) LEN(10)
             MONMSG (CPF0000)
          CHGVAR &FIELDP VALUE('P1')
             RTVJOBA    USER(&USER)

   START:
             SNDRCVF    DEV(*FILE) RCDFMT(FMT01) WAIT(*YES)
             RMVMSG     CLEAR(*ALL)

             IF         COND(&IN03) THEN(DO)
             IF         COND(&USER *EQ '&FIELDP') THEN(SIGNOFF)                     
             RETURN
             ENDDO

   /* F6-DISPLAY MESSAGES     */
             IF         COND(&IN06) THEN(DO)
             DSPMSG
             ENDDO

   /* START PRINT WRITER &FIELDP */
             IF         COND(&F2 *EQ 1) THEN(DO)
             STRPRTWTR  DEV(&FIELDP) OUTQ(&FIELDP)
             MONMSG     MSGID(CPF3310)
             ENDDO

   /* DISPLAY OUTPUT QUEUE &FIELDP   */
             IF         COND(&F2 *EQ 2) THEN(DO)
             WRKOUTQ    OUTQ(&FIELDP)
             ENDDO

   /* DISPLAY PRINTER MESSAGES &FIELDP */
             IF         COND(&F2 *EQ 3) THEN(DO)
             DSPMSG     MSGQ(&FIELDP)
             ENDDO

   /* DISPLAY spool file       &FIELDP */
             IF         COND(&F2 *EQ 4) THEN(DO)
             WRKSPLF    SELECT(*ALL &FIELDP)
             ENDDO

             GOTO       CMDLBL(START)

    ENDPGM
For comments or questions leave e-mail
Examples of other code for the AS/400
Return to my home page
Top of page