Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Scrollable Fields - My Solution. Now it works! ;-D

98 views
Skip to first unread message

Steve Coalbran

unread,
Oct 1, 2011, 10:09:13 AM10/1/11
to
This is my final solution for a (generalized) REXX function ZCSRVER which I actually built to verify that the CURSOR value used (for the FIELD scroll-control in this case) is valid.
This was really done as an educational exercise to learn about Scrollable-Fields but I believe I have a valid application for these as
The DB2 Table Creator and Table names are VARCHAR 128 (although rarely do they approach this length in my experience).

The driver is executed as: Command ===> TSO ZCSRVERT

...giving this...

| ---------------------------- Check Scrollable-Fields -------------------------
| Command ===> Scroll ===> HALF
|
| Report Options:
| DB2 SubSystem Id. . . . . . . . ____
| ----+----3----+----4----+----5----+----6 <>
| Plan table creator . . . . . . ________________________________________
| ----+----1----+----2----+----3----+----4 >
| Table name . . . . . . . . . . ________________________________________

Here is the position after I have pressed PF11 whilst the CURSOR is positioned within the "Plan table creator" field.

Both PF10 & PF11 work whilst one is positioned within either of the scrollable-fields.
The "Scroll" control (top-right, of USCROLLD) works to modify the scroll quantity.
Quantities allowed are (I trust) the same as those valid for any scroll operation: PAGE, HALF, DATA, CSR, or a number nnnn.
The scroll amount is overridable (as standard) by the ZCMD field which will change ZSCROLLA.
Hence setting ZCMD to MAX will scroll to make the end of the field visible... like so...
...
| -9----+---10----+---11----+---12----+--- <
| Plan table creator . . . . . . ________________________________________
| ----+----1----+----2----+----3----+----4 >
| Table name . . . . . . . . . . ________________________________________



This is the test driver ...

| /*REXX(ZCSRVERT)*/ TRACE "N"
| ADDRESS ISPEXEC
| "DISPLAY PANEL(ZCSRVER)"
| DO WHILE(RC=0)
| "DISPLAY PANEL(ZCSRVER)"
| END
| EXIT RC

This is the panel...

| )ATTR DEFAULT(%+_)
| /**PANEL(ZCSRVER)*****************************************************/
| /* Requires: ZSCRVER *REXX section function */
| /* Description: ZCSRVER is a sample ISPF panel to demonstrate field */
| /* scrolling and verify that the controlling value is */
| /* valid, otherwise set it to a default. */
| /* (the panel is based on a DBA utility to create LOAD */
| /* statements from an existing table, to allow cloning) */
| /*-------------------------------------------------------------------*/
| /* History: - Original Implementation SEP-2011 */
| /* Modifications: */
| /* YYYY-MM-DD BY Description */
| /* ---------- ---------- ------------------------------------------- */
| /* 20xx-xx-xx BY xxx */
| /*********************************************************************/
| @ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT) PAD(_) COLOR(TURQ)
| £ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT) PAD(_) COLOR(TURQ)
| } TYPE(TEXT) COLOR(GREEN) INTENS(LOW)
| § TYPE(OUTPUT) CAPS(OFF) JUST(ASIS)
| )BODY WIDTH(80)
| }---------------------------- Check Scrollable-Fields -------------------------+
| +Command ===>_Z +Scroll ===>_Z +
| +
| +Report Options:
| } DB2 SubSystem Id. . . . . . . .@SSID+ +
| + §TBCS §CI+
| } Plan table creator . . . . . .£TBCR + +
| } §TBNS §NI+
| } Table name . . . . . . . . . .£TBNA + +
| }
| )INIT
| .ZVARS = '(ZCMD,USCROLLD)'
| VGET(SSID,TBCR,TBNA,USCROLLD)
| *REXX(USCROLLD,ZSCROLLD,(ZCSRVER))
| VPUT(ZSCROLLD)
| )REINIT
| *REXX(USCROLLD,ZSCROLLD,(ZCSRVER))
| REFRESH(*)
| VPUT(ZSCROLLD)
| )PROC
| VPUT(SSID,TBCR,TBNA)
| )FIELD
| FIELD(TBCR) LEN(128) IND(CI,'<>') SCALE(TBCS) LCOL(TBCL)
| FIELD(TBNA) LEN(128) IND(NI,'<>') SCALE(TBNS) LCOL(TBNL)
| )END

This is the external rexx function...

| /**REXX(ZCSRVER)******************************************************/
| /* */
| /* Name: ZCSRVER */
| /* Type: *REXX exit */
| /* Author: Steve Coalbran */
| /* Requires: - */
| /* Description: ZCSRVER is an exit from a panel to verify a scroll */
| /* amount. Designed for use in a specific scrollable */
| /* field panel but can be of general use. */
| /* USCROLLD is the scrolling variable which is checked */
| /* and if invalid is set to the default. */
| /* Here the default is set to CSR (tailorable). */
| /* Syntax: */
| /* >>- *REXX(+--+USCROLLD,ZSCROLLD,(ZCSRVER))-------->< */
| /* +*,+ */
| /* */
| /* Invocation: See PANEL ZCSRVER */
| /*-------------------------------------------------------------------*/
| /* History: - Original Implementation SEP-2011 */
| /* Modifications: */
| /* YYYY-MM-DD BY Description */
| /* ---------- ---------- ------------------------------------------- */
| /* 20xx-xx-xx BY xxx */
| /* */
| /*********************************************************************/
| TRACE "N"
| zscrolld = CVERIFY(zscrolld,"CSR")
| zscrolld = CVERIFY(uscrolld,zscrolld)
|
| SIGNAL ENDREXX /************ Sub-Routine Area ************************/
|
| CVERIFY: PROCEDURE
| ARG samt,sdft
| IF( samt="" )THEN samt = sdft
| s1 = LEFT(samt,1)
| sv = VERIFY(samt,"0123456789")
| sp = POS(s1,"PHDC")
| SELECT
| WHEN( sp>0 )THEN
| samt = WORD("PAGE HALF DATA CSR",sp)
| WHEN( sv=0 ,
| ! sv>1 )THEN DO
| IF( sv>1 )THEN samt = LEFT(samt,sv-1)
| samt = RIGHT(samt,4,0)
| END
| OTHERWISE
| samt = sdft
| END/*SELECT*/
| RETURN samt
|
| ENDREXX: NOP /************** Sub-Routines End ************************/
|

/S

Steve Coalbran

unread,
Oct 1, 2011, 10:37:29 AM10/1/11
to
I should mention relating to this post that I am on swedish codepage (1143 Euro) so certain characters may appear differently,
especially in the REXX...
! = or (generally |)
^ = not (although I try to avoid its use <> = not-equal etc.)

--- deleted post content ---

/S

0 new messages