z/OS TSO/E CLISTs
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Writing full-screen applications using ISPF dialogs - the PROFILE CLIST

z/OS TSO/E CLISTs
SA32-0978-00

The CLIST language is well-suited for applications that invoke ISPF dialog management services to display full-screen panels. For more information about ISPF, see z/OS ISPF Services Guide.

The PROFILE CLIST is an example of a CLIST that displays entry panels on which the user can modify information. The PROFILE CLIST allows the user to perform any of the following functions to modify his or her profiles:
  • Set terminal characteristics.
  • Set LOG/LIST parameters.
  • Set PF keys (1-12).
  • Set PF keys (13-24).

The PROFILE CLIST receives control from a CLIST that displays the primary selection panel. The primary selection panel prompts the user to indicate which function is being requested (QCMD); and if the function is setting PF keys, which PF keys are to be viewed (QKEYS). Then, the CLIST invokes PROFILE, passing the values for QCMD and QKEYS.

PROFILE determines which selection was requested by referencing PROC statement keywords called QCMD and QKEYS.

If &QCMD is 1, PROFILE displays the terminal characteristics panel definition.

If &QCMD is 2, PROFILE displays the LOG/LIST parameters panel definition.

If &QCMD is 3 and &QKEYS is 12, PROFILE displays the PF keys 1-12 panel definition.

If &QCMD is 3 and &QKEYS is 24, PROFILE displays the PF keys 13-24 panel definition.

Panels are displayed using the ISPEXEC command.

When the user presses the END key after viewing, modifying, or viewing and modifying a particular panel, the value of &LASTCC is 8. By testing the value of &LASTCC, PROFILE can determine when the user is finished with the selection.

When the user is viewing one of the two PF key panels, the user can switch to the other panel by pressing the Enter key. PROFILE sets &QKEYS to the PF key (12 or 24) that represents the other panel so that the user can continue to switch back and forth if desired. Pressing Enter re-executes the DO-UNTIL-END sequence, causing PROFILE to test the value of &QKEYS to determine which panel to display. As with the other selection sequences, the PF key sequence ends when the user presses the END key.

Values set or changed on any of the four panels displayed by PROFILE are stored in the corresponding variables on the panel definitions.

Table 1 contains the purpose of, and figures containing, the PROFILE CLIST and its supporting four panel definitions.

Table 1. Purpose of, and figures containing, PROFILE CLIST and supporting panels
CLIST/Panel Purpose Figure
PROFILE Manage user profile panels 26
XYZABC10 Terminal characteristics panel 27
XYZABC20 LOG/LIST parameters panel 28
XYZABC30 PF keys 1-12 panel 29
XYZABC40 PF keys 13-24 panel 30

The PROFILE CLIST

 PROC 0 QCMD(1) QKEYS(12)

 /**********************************************************************/
 /*  THIS CLIST (PROFILE) DISPLAYS THE PANEL THAT CONTAINS THE PROFILE */
 /*  DATA THE USER WANTS TO UPDATE.  IT SETS THE FINISH FLAG TO NO AND */
 /*  THEN DETERMINES WHICH OF THE FOUR POSSIBLE PANELS THE USER NEEDS  */
 /*  DISPLAYED.                                                        */
 /**********************************************************************/

 CONTROL MSG END(ENDO)
 SET FINISH = NO
 /**********************************************************************/
 /*  IF THE USER WANTS TO UPDATE TERMINAL CHARACTERISTICS, DISPLAY     */
 /*  THE ASSOCIATED PANEL.                                             */
 /**********************************************************************/

 SELECT
 WHEN (&QCMD = 1) +
  DO UNTIL (&FINISH = YES)
   ISPEXEC DISPLAY PANEL(XYZABC10)   /* Display first panel            */
   IF &LASTCC = 8 THEN               /* If user presses END, */ +
    SET FINISH = YES                 /* end panel display              */
  ENDO
 /**********************************************************************/
 /*  IF THE USER WANTS TO UPDATE LOG/LIST PARAMETERS, DISPLAY          */
 /*  THE ASSOCIATED PANEL.                                             */
 /**********************************************************************/

 WHEN (&QCMD = 2) +
   DO UNTIL (&FINISH = YES)
   ISPEXEC DISPLAY PANEL(XYZABC20)   /* Display 2nd panel              */
   IF &LASTCC = 8 THEN               /* If user presses END, */ + 
    SET FINISH = YES                 /* end panel display.             */
   ENDO
 /**********************************************************************/
 /* IF THE USER WANTS TO UPDATE PF KEYS, DETERMINE WHICH GROUP THE     */
 /* USER WANTS TO UPDATE: 1-12 or 13-24.  DISPLAY THE ASSOCIATED PANEL.*/
 /**********************************************************************/
 WHEN (&QCMD = 3) +
   DO UNTIL (&FINISH = YES)
    IF &QKEYS = 12 THEN +
     DO
      ISPEXEC DISPLAY PANEL(XYZABC30)  /* Display PF keys 1-12         */
      IF &LASTCC = 8 THEN              /* If user presses END,  */ + 
       SET FINISH = YES                /* end panel display.           */
      ELSE +
       SET QKEYS = 24                  /* If user presses ENTER,       */
     ENDO                              /* display next panel.          */
    ELSE +
     DO
      ISPEXEC DISPLAY PANEL(XYZABC40)  /* Display PF keys 13-24        */
      IF &LASTCC = 8 THEN              /* If user presses END,  */ + 
       SET FINISH = YES                /* end panel display.           */
      ELSE +
       SET QKEYS = 24                  /* If user presses ENTER,       */
     ENDO                              /* display previous panel.      */
   ENDO
 ENDO         /* End of SELECT statement
 /*
 /*   EXIT ROUTINE
 /*
 FINAL: +
 SET FCODE = 0
 EXIT CODE(&FCODE)
The panels displayed by the PROFILE CLIST appear on the following pages in panel definition form. In order for the PROFILE CLIST to display them, the panels must be members of a partitioned data set allocated to the file ISPPLIB, for example:
allocate file(ispplib) dataset(test.panels)
For more information about how to create and allocate ISPF panel definitions, see z/OS ISPF Services Guide.

The Terminal characteristics panel definition (XYZABC10)

 )ATTR DEFAULT(%+_)
       /*  % TYPE(TEXT) INTENS(HIGH)      defaults displayed for       */
       /*  + TYPE(TEXT) INTENS(LOW)       information only             */
       /*  _ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT)              */
   @ TYPE(INPUT) INTENS(HIGH) PAD(_) CAPS(ON)
 )BODY
 +            SAMPLE - SET THE TERMINAL CHARACTERISTICS
 %COMMAND ===	_ZCMD                                                        + 
 %
+Type the information where requested, or change the information shown
 +by typing over it:
 + 
 +   TERMINAL TYPE    %===	@Z    +    3277, 3277A, 3278, 3278A, or 3278T   + 
 +   NUMBER OF PF KEYS%===>@Z +       12 or 24
 +   INPUT FIELD PAD  %===>@Z+        Nulls (N) or Blanks (B)
 +   SCREEN FORMAT    %===>@Z   +     (3278 Model 5 only) DATA, STD, or MAX
 +   COMMAND DELIMITER%===>@Z+        Any special character
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 )INIT
   .ZVARS = '(ZTERM ZKEYS ZPADC ZSF ZDEL)'
   &ZSF  = TRANS (&ZFMT D,DATA S,STD M,MAX *,' ')
 )PROC
  IF (&ZCMD ¬= ' ') .MSG = ISPZ001      /* NOT VALID COMMAND      */
  VER (&ZTERM NB LIST 3277,3277A,3278,3278A,3278T)
  &ZCHARLM = TRANS(&ZTERM
                   3277  ,  ISP3277
                   3277A ,  ISP3277A
                   3278  ,  ISP3278
                   3278A ,  ISP3278A
                   3278T ,  ISP3278T)
  VER (&ZKEYS NB LIST 12,24)
  IF  (&ZKEYS = 24)
    VER (&ZTERM LIST 3278 MSG=ISPO002)
  VER (&ZPADC NB LIST N,B)
  VER (&ZSF,NONBLANK)
  &ZFMT = TRUNC (&ZSF,1)
  VER (&ZFMT,LIST  D,S,M)
  VER (&ZDEL NB PICT C)
  IF (.MSG ¬= ' ')
    .RESP = ENTER
 )END

The LOG/LIST characteristics panel definition (XYZABC20)

 )ATTR DEFAULT(%+_)
       /*  % TYPE(TEXT) INTENS(HIGH)      defaults displayed for       */
       /*  + TYPE(TEXT) INTENS(LOW)       information only             */
       /*  _ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT)              */
   @ TYPE(INPUT) INTENS(HIGH) PAD(_) CAPS(ON)
 )BODY
 +              SAMPLE - SET THE LOG/LIST PARAMETERS
 %COMMAND  ===>_ZCMD                                                   + 
 %
+Type the information where requested, or change the information shown
 +by typing over it:
 + 
 +                         %LOG                     %LIST                   + 
 + 
 +   PROCESS OPTION   %===>@Z+                      @Z+ 
 +   SYSOUT CLASS     %===>@Z              +        @Z              + 
 +   LOCAL PRINTER ID %===>@Z       +               @Z       + 
 +   LINES PER PAGE   %===>@Z +                     @Z + 
 +   PRIMARY PAGES    %===>@Z   +                   @Z   + 
 +   SECONDARY PAGES  %===>@Z   +                   @Z   + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 )INIT
   .ZVARS = '(ZLOGFDSP,ZLSTFDSP,ZLOGCLA,ZLSTCLA,ZLOGPID,ZLSTPID, + 
              ZLOGLIN,ZLSTLIN,ZLOG1PG,ZLST1PG,ZLOG2PG,ZLST2PG)'

 )PROC
   IF (&ZCMD ¬= ' ') .MSG = ISPZ001      /* NOT VALID COMMAND     */
   VER (&ZLOGFDSP  LIST J,L,K,D,' ')
   VER (&ZLSTFDSP  LIST J,L,K,D,' ')
   IF (&ZLOGFDSP = J)
     VER (&ZLOGCLA,NB)
   IF (&ZLOGFDSP = L)
     VER (&ZLOGPID,NB)
   IF (&ZLSTFDSP = J)
     VER (&ZLSTCLA,NB)
   IF (&ZLSTFDSP = L)
     VER (&ZLSTPID,NB)
   VER (&ZLOGLIN   NB NUM)
   VER (&ZLOGLIN   RANGE 1,99)
   VER (&ZLSTLIN   NB NUM)
   VER (&ZLSTLIN   RANGE 1,99)
   VER (&ZLOG1PG   NB NUM)
   VER (&ZLOG1PG   RANGE 0,9999)
   VER (&ZLST1PG   NB NUM)
   VER (&ZLST1PG   RANGE 1,9999)
   VER (&ZLOG2PG   NB NUM)
   VER (&ZLOG2PG   RANGE 0,9999)
   VER (&ZLST2PG   NB NUM)
   VER (&ZLST2PG   RANGE 1,9999)
   IF (&ZLOG1PG = 0)
     VER (&ZLOG2PG,NB)
     VER (&ZLOG2PG,RANGE,0,0)
   IF (&ZLOG1PG ¬= 0)
     VER (&ZLOG2PG,NB NUM)
     VER (&ZLOG2PG,RANGE,1,9999)
   IF (.MSG ¬= ' ' )
     .RESP = ENTER
 )END

The PF keys 1-12 panel definition (XYZABC30)

 )ATTR DEFAULT(%+_)
       /*  % TYPE(TEXT) INTENS(HIGH)      defaults displayed for       */
       /*  + TYPE(TEXT) INTENS(LOW)       information only             */
       /*  _ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT)              */
   @ TYPE(INPUT) INTENS(HIGH) PAD(_) CAPS(ON)
 )BODY
 +                   SAMPLE - SET PF KEYS 1-12
 %COMMAND ===>_ZCMD	 +
 %
 +Type the information where requested, or change the information shown
 +by typing over it:
 + 
 +   PF1   %===>@QPF01	+
 +   PF2   %===>@QPF02	+
 +   PF3   %===>@QPF03	+
 +   PF4   %===>@QPF04	+
 +   PF5   %===>@QPF05	+
 +   PF6   %===>@QPF06	+
 +   PF7   %===>@QPF07	+
 +   PF8   %===>@QPF08	+
 +   PF9   %===>@QPF09	+
 +   PF10  %===>@QPF10	+
 +   PF11  %===>@QPF11	+
 +   PF12  %===>@QPF12	+
 + 
 + 
 + 
 + 
 + 
 + 
 )INIT
  IF (&QPF01 = ' ')
    &QPF01 = HELP
  IF (&QPF02 = ' ')
    &QPF02 = SPLIT
  IF (&QPF03 = ' ')
    &QPF03 = END
  IF (&QPF04 = ' ')
    &QPF04 = RETURN
  IF (&QPF05 = ' ')
    &QPF05 = RFIND
  IF (&QPF06 = ' ')
    &QPF06 = RCHANGE
  IF (&QPF07 = ' ')
    &QPF07 = UP
  IF (&QPF08 = ' ')
    &QPF08 = DOWN
  IF (&QPF09 = ' ')
    &QPF09 = SWAP
  IF (&QPF10 = ' ')
    &QPF10 = LEFT
  IF (&QPF11 = ' ')
    &QPF11 = RIGHT
  IF (&QPF12 = ' ')
    &QPF12 = CURSOR
 )PROC
  IF (&ZCMD ¬= ' ') .MSG = ISPZ001
  IF (&QPF01 = ' ')
    &QPF01 = HELP
  IF (&QPF02 = ' ')
    &QPF02 = SPLIT
  IF (&QPF03 = ' ')
    &QPF03 = END
  IF (&QPF04 = ' ')
    &QPF04 = RETURN
  IF (&QPF05 = ' ')
    &QPF05 = RFIND
  IF (&QPF06 = ' ')
    &QPF06 = RCHANGE
  IF (&QPF07 = ' ')
    &QPF07 = UP
  IF (&QPF08 = ' ')
    &QPF08 = DOWN
  IF (&QPF09 = ' ')
    &QPF09 = SWAP
  IF (&QPF10 = ' ')
    &QPF10 = LEFT
  IF (&QPF11 = ' ')
    &QPF11 = RIGHT
  IF (&QPF12 = ' ')
    &QPF12 = CURSOR
  IF (.MSG ¬= ' ')
    .RESP = ENTER
 )END

The PF keys 13-24 panel definition (XYZABC40)

 )ATTR DEFAULT(%+_)
       /*  % TYPE(TEXT) INTENS(HIGH)      defaults displayed for       */
       /*  + TYPE(TEXT) INTENS(LOW)       information only             */
       /*  _ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT)              */
   @ TYPE(INPUT) INTENS(HIGH) PAD(_) CAPS(ON)
 )BODY
 +                   SAMPLE - SET PF KEYS 13-24
 %COMMAND ===>_ZCMD                                                       + 
 %
+Type the information where requested, or change the information shown
 +by typing over it; then, to set PF keys 1-12, press ENTER.
 + 
 +   PF13  %===>@QPF13                                                   + 
 +   PF14  %===>@QPF14                                                   + 
 +   PF15  %===>@QPF15                                                   + 
 +   PF16  %===>@QPF16                                                   + 
 +   PF17  %===>@QPF17                                                   + 
 +   PF18  %===>@QPF18                                                   + 
 +   PF19  %===>@QPF19                                                   + 
 +   PF20  %===>@QPF20                                                   + 
 +   PF21  %===>@QPF21                                                   + 
 +   PF22  %===>@QPF22                                                   + 
 +   PF23  %===>@QPF23                                                   + 
 +   PF24  %===>@QPF24                                                   + 
 + 
 + 
 + 
 + 
 + 
 + 
 )INIT
  IF (&QPF13 = ' ')
    &QPF13 = HELP
  IF (&QPF14 = ' ')
    &QPF14 = SPLIT
  IF (&QPF15 = ' ')
    &QPF15 = END
  IF (&QPF16 = ' ')
    &QPF16 = RETURN
  IF (&QPF17 = ' ')
    &QPF17 = RFIND
  IF (&QPF18 = ' ')
    &QPF18 = RCHANGE
  IF (&QPF19 = ' ')
    &QPF19 = UP
  IF (&QPF20 = ' ')
    &QPF20 = DOWN
  IF (&QPF21 = ' ')
    &QPF21 = SWAP
  IF (&QPF22 = ' ')
    &QPF22 = LEFT
  IF (&QPF23 = ' ')
    &QPF23 = RIGHT
  IF (&QPF24 = ' ')
    &QPF24 = CURSOR
 )PROC
  IF (&ZCMD ¬= ' ') .MSG = ISPZ001
  IF (&QPF13 = ' ')
    &QPF13 = HELP
  IF (&QPF14 = ' ')
    &QPF14 = SPLIT
  IF (&QPF15 = ' ')
    &QPF15 = END
  IF (&QPF16 = ' ')
    &QPF16 = RETURN
  IF (&QPF17 = ' ')
    &QPF17 = RFIND
  IF (&QPF18 = ' ')
    &QPF18 = RCHANGE
  IF (&QPF19 = ' ')
    &QPF19 = UP
  IF (&QPF20 = ' ')
    &QPF20 = DOWN
  IF (&QPF21 = ' ')
    &QPF21 = SWAP
  IF (&QPF22 = ' ')
    &QPF22 = LEFT
  IF (&QPF23 = ' ')
    &QPF23 = RIGHT
  IF (&QPF24 = ' ')
    &QPF24 = CURSOR
  IF (.MSG ¬= ' ')
    .RESP = ENTER
 )END

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014