© robvan hoboken@newsgroup

Displays the table content on the screen. The name of the table to be viewed is passed to the program. After every output line the program stops and waits for user input. If the ENTER key is hit, the next table element is displayed, otherwise the table display is terminated.


/* REXX to print the contents of an ISPF table
   Another small program I once wrote for one purpose only (no docs)...
   Just call this Rexx with the name of the table you wish to view.
   Press ENTER for the next line in the table.
*/
address 'ISPEXEC'
tb = arg(1)
'TBSTATS' tb 'STATUS2(OPEN)'
if open = 1 then 'TBOPEN' tb 'NOWRITE'
'TBQUERY' tb 'KEYS(K) NAMES(N) ROWNUM(R)'
say 'Keys:' k
say 'Names:' n
parse var k '(' k ')'
parse var n '(' n ')'
'TBTOP' tb
do i=1 to r until stop <> ''
  'TBSKIP' tb
  'TBGET' tb 'ROWID(P)'
  say 'Line:' p
  if words(k) > 0 then do j=1 to words(k)
    key = word(k,j)
    say 'key:' key value(key)
  end
  if words(n) > 0 then do j=1 to words(n)
    key = word(n,j)
    say 'var:' key value(key)
  end
  pull stop
end
if open = 1 then 'TBCLOSE' tb
back to REXX with ISPF