Overview
In the previous post, the December 2018 calendar is displayed using one color, green, including an asterisk to indicate today’s date. As a hobbyist, you always want to spruce up displays – apply new features of a tool, ISPF.
___DECEMBER 2018____
S M T W T F S
. . . . . . 1
2 3 4 5 6 7 8
9 10 11 12 13 14*15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
A unique feature of a dynamic AREA on a panel is the string variable (dialog variable) which can include data and attribute information. This is demonstrated in the first post where the attribute control character ‘[‘ overlays the first position of each calendar row resulting in a calendar with a green foreground color.
Additional colors will be incorporated into the panel definition to enhance highlighting and incrementally build up the previous learning exercise. The weekend days, Sunday and Saturday, are colorized as turquoise. Today’s date is colorized as pink. All other days and dates are colorized in blue. And, lastly, the month name and year are colorized green.
1...5....0....5....0.... ___DECEMBER 2018____ S M T W T F S . . . . . . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
See the ISPF Dialog Developers Reference manual for more information on panel definitions including dynamic areas under the )ATTR header.
The Code
Let’s get down to the learning business!
Below are the modified components introduced in the last post modified to demonstrate the new calendar color scheme on your MVS 3.8J system with ISPF 2.x!
1) This component simulates the setting of symbolic variable, CALENDAR, and displays its content on panel PCAL02 using the AREA tag definition. New color attributes are incorporated for the new color scheme.
– Copy-paste and save the following CLIST as SYS2.CMDPROC(CCAL02):
PROC 0
/****************************************************************/
/* CLIST: CCAL02 To demonstrate a CALENDAR display */
/* on panel PCAL02 */
/****************************************************************/
/* Declare CALENDARn ROW variable with data */
SET CALENDAR1 = &STR( ___DECEMBER 2018____) /* Row 1*/
SET CALENDAR2 = &STR( S M T W T F S) /* Row 2*/
SET CALENDAR3 = &STR( . . . . . . 1) /* Row 3*/
SET CALENDAR4 = &STR( 2 3 4 5 6 7 8) /* Row 4*/
SET CALENDAR5 = &STR( 9 10 11 12 13 14*15) /* Row 5*/
SET CALENDAR6 = &STR( 16 17 18 19 20 21 22) /* Row 6*/
SET CALENDAR7 = &STR( 23 24 25 26 27 28 29) /* Row 7*/
SET CALENDAR8 = &STR( 30 31 ) /* Row 8*/
/* Add '[' green attribute month-year row */
SET CALENDAR = &STR([)&SUBSTR(2:021,&STR(&CALENDAR1))
/* Add ']' turq attribute to week day row */
SET CALENDAR = &STR(&CALENDAR)&STR(])&SUBSTR(2:021,&STR(&CALENDAR2))
/* Add '$' blue attribute to other rows */
SET CALENDAR = &STR(&CALENDAR)&STR($)&SUBSTR(2:021,&STR(&CALENDAR3))
SET CALENDAR = &STR(&CALENDAR)&STR($)&SUBSTR(2:021,&STR(&CALENDAR4))
SET CALENDAR = &STR(&CALENDAR)&STR($)&SUBSTR(2:021,&STR(&CALENDAR5))
SET CALENDAR = &STR(&CALENDAR)&STR($)&SUBSTR(2:021,&STR(&CALENDAR6))
SET CALENDAR = &STR(&CALENDAR)&STR($)&SUBSTR(2:021,&STR(&CALENDAR7))
SET CALENDAR = &STR(&CALENDAR)&STR($)&SUBSTR(2:021,&STR(&CALENDAR8))
/* Additional Color customization starts here... */
SET CALENDARH = &SUBSTR(1:024,&STR(&CALENDAR))
/* Add '$' blue attribute starting at Monday, row 2 */
SET CALENDARH = &STR(&CALENDARH)&STR($)&SUBSTR(026:039,&STR(&CALENDAR))
/* Add ']' turq attribute starting at Saturday, row 2 */
SET CALENDARH = &STR(&CALENDARH)&STR(])&SUBSTR(041:102,&STR(&CALENDAR))
/* Add '?' pink attribute at December 15, row 5 */
SET CALENDARH = &STR(&CALENDARH)&STR(?)&SUBSTR(104:168,&STR(&CALENDAR))
SET CALENDAR = &STR(&CALENDARH)
/* Display panel with calendar area */
ISPEXEC DISPLAY PANEL(PCAL02)
END
2) This component is the panel definition with three new TYPE tags.
– Copy-paste and save the following PANEL as xxxxxxxx.ISPPLIB(PCAL02): (ISPF panel library)
Note: Editor needs access to all 80 columns for this copy-paste operation.
)ATTR /* % TYPE(TEXT) INTENS(HIGH) defaults displayed for */ /* + TYPE(TEXT) INTENS(LOW) information only */ /* _ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT) */ + TYPE(TEXT) INTENS(LOW) SKIP(ON) COLOR(GREEN) % TYPE(TEXT) INTENS(HIGH) SKIP(ON) COLOR(WHITE) ^ TYPE(TEXT) INTENS(LOW) SKIP(ON) COLOR(YELLOW) _ TYPE(INPUT) INTENS(LOW) JUST(LEFT) COLOR(TURQ) } TYPE(OUTPUT) INTENS(LOW) JUST(RIGHT) * AREA(DYNAMIC) SCROLL(ON) [ TYPE(DATAOUT) INTENS(LOW) COLOR(GREEN) ] TYPE(DATAOUT) INTENS(LOW) COLOR(TURQ)
? TYPE(DATAOUT) INTENS(LOW) COLOR(PINK)
$ TYPE(DATAOUT) INTENS(HIGH) COLOR(BLUE)
)BODY WIDTH(&ZSCREENW) EXPAND(//) %---------------------- Sample Menu for CALENDAR Demo -------------------------- %OPTION ===>_ZCMD + % %USERID - &ZUSER + % 0 +MENU1 -^Menu option 1 not operational %TIME - &ZTIME + % 1 +MENU2 -^Menu option 1 not operational %TERMINAL - &ZTERM + % %PF KEYS - &ZKEYS + % %DATE - &ZDATE + % %- &ZJDATE + % This menu is for demo purposes only and has %SYSTEM -^&ZSYSID + % minimal definition. %TSO-PROC -^&ZSYSPROC % %PANEL - &ZPANELID % %APPLID - &ZAPPLID+ % %TermSize}z }z ++ % + % *CALENDAR *+ % Notice the calendar * *+ % display here ---------> * *+ % * *+ % 8 rows, 21 byte row length * *+ % * *+ % * *+ % * *+ % + + %PF3+END + )INIT .ZVARS = '(ZSCREEND ZSCREENW)' )PROC )END
3) From your TSO command line, type %CCAL02, press <ENTER>.
– The following panel will display. Note the enhanced color scheme for the calendar.
---------------------- Sample Menu for CALENDAR Demo -------------------------- OPTION ===> USERID - LARRY01 0 MENU1 - Menu option 1 not operational TIME - 10:20 1 MENU2 - Menu option 1 not operational TERMINAL - 3277 PF KEYS - 0012 DATE - 12/05/20 - 20.133 This menu is for demo purposes only and has SYSTEM - BSP1 minimal definition. TSO-PROC - ISPLGN00 PANEL - PCAL02 APPLID - ISP TermSize 0056 0090 ___DECEMBER 2018____ Notice the calendar S M T W T F S display here ---------> . . . . . . 1 2 3 4 5 6 7 8 8 rows, 21 byte row length 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 PF3 END
4) Congratulations! You completed this demonstration successfully.
The next post will explore an approach to refresh the calendar every time the panel is used, thus, displaying a current calendar, specifically, when a date change occurs
Some of us like to work past mid-night!
Stay tuned!
Closing
Please use the comment box below or the contact us link on the menu bar to communicate any suggestions, improvements, corrections or issues regarding this post.
Thank You.