© robvan hoboken@newsgroup

Ausgabe eines Tabelleninhaltes. Dem Programm wird der Name der Tabelle mitgegeben, deren Inhalte gezeigt werden sollen. Nach jeder Zeile wird angehalten und auf Bedienereingabe gewartet. Wird nur die ENTER-Taste gedrückt, wird die nächste Tabellenzeile gezeigt, anderenfalls wird die Anzeige beendet.


/* 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
zurück zu REXX mit Dialog Manager