IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to define a ISPF panel with uncertain lines


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chaoj

Active User


Joined: 03 Jun 2010
Posts: 103
Location: Dalian

PostPosted: Wed May 04, 2011 10:47 am
Reply with quote

I want to create a panel and it displays the user search results

I use stem.n to keep the results and n is uncertain as the user search.

How should I define a panel to display the results ?

thanks all !
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed May 04, 2011 11:41 am
Reply with quote

This has nothing to do with REXX or CLIST. Next time post in the ISPF forum.

Use a dynamic area.

Let's be generous for a change, code comes from another forum that is currently defunct, so I cannot properly attribute it, sorry.
Code:

/* REXX exec to show use of ISPF dynamic areas                        */
parse source source
parse value source with . . moi .

call load_dynlib

"ispexec libdef ispplib library id("dynlib") stack"

"ispexec control display save"

/***********************************************************************
* Example 1, scrollable dynamic area                                   *
***********************************************************************/
red      = '01'x                            /* Assign colors to       */
blue     = '02'x                            /*  Attribute bytes       */
green    = '03'x                            /*   found in the data    */
white    = '04'x
maxlines = 600                              /* max number of lines    */
dyndata  = ''                               /* initialize data        */

do a = 1 to maxlines by 3                   /* Create dummy data      */
  dyndata = dyndata || white ||,
            left('This is'red   || 'red  'white || a,     29)
  dyndata = dyndata || white ||,
            left('This is'blue  || 'blue 'white || a + 1, 29)
  dyndata = dyndata || white ||,
            left('This is'green || 'green'white || a + 2, 29)
end

/***********************************************************************
* Add a bottom of data maker to the end of the data                    *
***********************************************************************/
dyndata   = dyndata || blue ||,
            center(green || 'BOTTOM' || blue, 29, '*')

curline = 1                                 /* set current line #     */

/***********************************************************************
* Loop until end of error                                              *
***********************************************************************/
do until disprc > 0
  dynarea = substr(dyndata,1+(curline-1)*30)  /* set dynamic variable */
  size = length(dynarea)                    /* Set a scalar variable  */

  "ispexec display panel(dynpanel)"         /* Display the data       */
  disprc = rc                               /* save return code       */

  "ispexec vget (zverb,zscrolla,zscrolln)"  /* get scroll values      */

  select                                    /* Process scrolling      */
    when zverb = 'UP' then                  /* Scroll up              */
      if zscrolla = 'MAX' then              /*  if scroll was max     */
       curline = 1                          /*    scroll to top       */
      else                                  /*  else a number is known*/
       curline = max(1, curline - zscrolln) /* (maximum is top)       */

    when zverb = 'DOWN' then                /* Scroll down            */
      if zscrolla = 'MAX' then              /*  if scroll was max     */
       curline = maxlines                   /*    scroll to bottom    */
      else                                  /*  else a number is known*/
       curline = min(maxlines, curline + zscrolln)   /* max is bottom */

    otherwise                           /* could use left & right too */
  end
end                                         /* End of display loop    */
exit

/***********************************************************************
* LOAD_DYNLIB:                                                         *
*                                                                      *
* This procedure loads the via EPANQ generated panel, message and/or   *
* skeleton code into a library. Note that there is no reason to use    *
* different libraries for any of these objects, as long as they are    *
* named differently|                                                   *
***********************************************************************/
load_dynlib:
dynlib = 'dyn'random(99999)
alloc  = "alloc fi("dynlib") rtdsn(sysdsname) "   ||,
                   "lrecl(80) blksize(0) dir(5) " ||,
                   "new delete reuse "            ||,
                   "space(1,1)"
rc = bpxwdyn(alloc)

if rc = 0 then
  ispdyn = sysdsname
else
  ispdyn = 'NOT FOUND'

"newstack"

member = 'DYNPANEL'

queue ')attr'
queue ' @  area(dynamic) scroll(on) extend(on)'
queue ' 01 type(dataout) color(red)'
queue ' 02 type(dataout) color(blue)'
queue ' 03 type(dataout) color(green)'
queue ' 04 type(dataout) color(white)'
queue ' $  type(text)    color(yellow)'
queue ')body expand(||)'
queue '%-|-|- Example for using a dynamic area -|-|-'
queue '%Command ===>_zcmd                                        ' ||,
      '    %Scroll ===>_AMT +'
queue '%'
queue '+ This area is fixed.   Size: &size'
queue '+'
queue '+ This is an input field%===>_somevar +'
queue '+'
queue '+This is extendable  @dynarea                     @'
queue ' '
queue '       $This should be at the bottom of the screen when in' ||,
      ' full screen.'
queue ')end'

put_object:
  tfil = 'tfil'random(9999)

  "alloc f("tfil") da('"ispdyn"("member")') shr reu"
  "execio" queued() "diskw "tfil" (finis"
  "free f("tfil")"

  "delstack"
return
Back to top
View user's profile Send private message
chaoj

Active User


Joined: 03 Jun 2010
Posts: 103
Location: Dalian

PostPosted: Wed May 04, 2011 12:12 pm
Reply with quote

Prino Thanks !!
although I don't understand the code , I'll keep reading.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed May 04, 2011 12:54 pm
Reply with quote

Or consider the use of ISPF tables
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed May 04, 2011 12:58 pm
Reply with quote

Keep in mid this is sample code, all my sample code is completely self-contained, under normal circumstances the panel would be in a library concatenated to ISPPLIB.

The dynamic generation of the panel allows me to take the code from site to site without having to worry about setting up libraries, other than allocating my lib to //SYSEXEC (or //SYSUEXEC)
Back to top
View user's profile Send private message
chaoj

Active User


Joined: 03 Jun 2010
Posts: 103
Location: Dalian

PostPosted: Wed May 04, 2011 1:37 pm
Reply with quote

prino wrote:
Keep in mid this is sample code, all my sample code is completely self-contained, under normal circumstances the panel would be in a library concatenated to ISPPLIB.

The dynamic generation of the panel allows me to take the code from site to site without having to worry about setting up libraries, other than allocating my lib to //SYSEXEC (or //SYSUEXEC)


OK, I see , really a good way .
Back to top
View user's profile Send private message
chaoj

Active User


Joined: 03 Jun 2010
Posts: 103
Location: Dalian

PostPosted: Wed May 04, 2011 1:37 pm
Reply with quote

expat wrote:
Or consider the use of ISPF tables


thanks expat !!
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Wed May 04, 2011 6:40 pm
Reply with quote

I think an ISPF table is preferable because, in addition to displaying the results, you can use a table to allow the user to select one of the found items for further action.

Yes, I know you can do the same with dynamic areas, but it is easier with a table.

Where dynamic areas have an advantage is in display rows with different colors than other rows.
Back to top
View user's profile Send private message
Peter Nancollis

New User


Joined: 15 Mar 2011
Posts: 47
Location: UK

PostPosted: Thu May 05, 2011 5:21 am
Reply with quote

Displaying and accessing search results [assume we are talking about SuperC] Jim Narramore's excellent SRCHLIST takes alot of beating.
Pops a list of members where something has been found - allowing review just the result /browse/edit ... a truely wonderful productivity aid [ may even now be in base code - i have never bothered to look ]
wrap a harness around it so that you can just use vs a dset from dslist
eg @srchfor / blah-de-blah
It has saved me hours, but as ever ymmv
Back to top
View user's profile Send private message
chaoj

Active User


Joined: 03 Jun 2010
Posts: 103
Location: Dalian

PostPosted: Thu May 05, 2011 6:54 am
Reply with quote

Pedro wrote:
I think an ISPF table is preferable because, in addition to displaying the results, you can use a table to allow the user to select one of the found items for further action.

Yes, I know you can do the same with dynamic areas, but it is easier with a table.

Where dynamic areas have an advantage is in display rows with different colors than other rows.


thanks for your explanation
I think I did not explain my request clearly , my search result is help characters for reference, so I have used the dynamic areas to complete it with color.

thanks all again !
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu May 05, 2011 10:28 am
Reply with quote

Peter Nancollis wrote:
Displaying and accessing search results [assume we are talking about SuperC] Jim Narramore's excellent SRCHLIST takes alot of beating.
Pops a list of members where something has been found - allowing review just the result /browse/edit ... a truely wonderful productivity aid [ may even now be in base code - i have never bothered to look ]
wrap a harness around it so that you can just use vs a dset from dslist
eg @srchfor / blah-de-blah
It has saved me hours, but as ever ymmv

I'm pretty sure that using SRCHFOR from the memberlist in edit and view now has more or less the same functionality.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Thu May 05, 2011 6:10 pm
Reply with quote

prino wrote:
Peter Nancollis wrote:
Displaying and accessing search results [assume we are talking about SuperC] Jim Narramore's excellent SRCHLIST takes alot of beating.
Pops a list of members where something has been found - allowing review just the result /browse/edit ... a truely wonderful productivity aid [ may even now be in base code - i have never bothered to look ]
wrap a harness around it so that you can just use vs a dset from dslist
eg @srchfor / blah-de-blah
It has saved me hours, but as ever ymmv

I'm pretty sure that using SRCHFOR from the memberlist in edit and view now has more or less the same functionality.
I can confirm that. You can use SRCHFOR on a member list and also tell it to filter the search results so that only the members with 'hits' are displayed. From there you can Browse/Edit etc the member or do another SRCHFOR on the remaining subset.

The product SimpList , a favorite of mine, has had this capability for many years. Use [URL] BBCode for External Links One advantage that it has over SRCHFOR is that after performing several consecutive searches on a member list you can back your way up the results chain by hitting PF3. This makes it very easy to fix mistakes without having to start all over again.
Back to top
View user's profile Send private message
Peter Nancollis

New User


Joined: 15 Mar 2011
Posts: 47
Location: UK

PostPosted: Sun May 08, 2011 3:19 am
Reply with quote

@ don
Quote:
The product SimpList , a favorite of mine,

How wonderful to work somewhere that investments in quality tools--- very envious, but agree with the sentiments
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Sun May 08, 2011 4:43 am
Reply with quote

Peter Nancollis wrote:
@ don
Quote:
The product SimpList , a favorite of mine,

How wonderful to work somewhere that investments in quality tools--- very envious, but agree with the sentiments
I wish. That was my former shop. I am presently working for a company that doesn't have SimpList, and I am still mourning the loss. icon_sad.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Looking for a little history of ISPF ... TSO/ISPF 5
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
Search our Forums:

Back to Top