Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ISPF tables

Status
Not open for further replies.

vhagopian

Programmer
Nov 12, 2002
9
US
Once i have displayed an ISPF table, i want to do a "find" on something displayed in the table from the command line, much like i do in ISPF edit. Can someone give me an easy way to do this in REXX?
 
You need to remember that the difference is that data in a table is structured in rows and not data like in ISPF edit. Because each row contains data in keys or names, it's not such a simple task as you need to look for the string in either a specific key or name, or all.

I would use something like this;

"TBSkip MYTABLE"
do while rc = 0
if index(MyKey, Parm) > 0 then leave
"TBSkip MYTABLE"
end

But obviously you would need to find a way of prompting for or defaulting to the key or name, and setting the value of parm (but this would be part of the table display).
 
If you know which table variable contains the value you seek it's easier:
Code:
address ISPEXEC 
"TBVCLEAR" $tn$   /* clear all variables */
name = "SMITH"    /* All SMITHs */
state = "CO"      /* living in Colorado */
do forever
   /* find upscale addresses :-) */
   "TBSCAN" $tn$
   if rc > 0 then leave 
   if Pos("Blvd",straddr) > 0 then say,
      name straddr city state zip 
end

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top