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

Where do FIND and RFIND store the search target?


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

New User


Joined: 01 Nov 2008
Posts: 5
Location: Kansas City MO

PostPosted: Fri Nov 07, 2008 8:04 am
Reply with quote

I'd like to use the target of the last FIND command in an edit macro. Where is the target from the Find command stored, and how can I retrieve it?

Obviously it's there someplace, or the RFIND command wouldn't work...
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri Nov 07, 2008 12:25 pm
Reply with quote

Code:
"ISREDIT (CRSLINE,CRSCOL) = CURSOR"

Will store the line number and column number of the cursor at the time that the statement was executed.

Click HERE to access the manual.
Back to top
View user's profile Send private message
James Magruder

New User


Joined: 01 Nov 2008
Posts: 5
Location: Kansas City MO

PostPosted: Fri Nov 07, 2008 11:27 pm
Reply with quote

Actually I'm trying to get the info from a FIND command that was used before my macro was invoked.

So, if the last FIND command was "FIND PREV ABCDE", I want to modify it, and issue the command "FIND NEXT ABCDE", or maybe "FIND WORD ABCDE".

The RFIND command retrieves the info from the previous Find command. I want to grab that info, just like RFIND does. But I can't find where it's stored.

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ispedt03/3.3.97?ACTION=MATCHES&REQUEST=USER+STATE&TYPE=FUZZY&SHELF=ISPBKM08.bks&DT=19990720125310&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT

The Edit manual does drop a hint that USER_STATE stores the Find info:
-----
The USER_STATE assignment statement saves or restores the state of edit profile values, FIND, CHANGE, SEEK, and EXCLUDE values, and panel and cursor values.
-----

But that's not enough to go on.

edited to put the correct url
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 07, 2008 11:51 pm
Reply with quote

please especially when posting links ( like in the previous post )
use the preview button to see what the post looks like,
and test the link to see if it takes where You want us to be taken icon_biggrin.gif

the previous link takes to nowhere
- I am not worried since I work on a mac, but the windoze community might object
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Sat Nov 08, 2008 3:38 am
Reply with quote

I do not know where it is found, but to do another search on the same string you can use * to refer to the string you found last.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat Nov 08, 2008 9:30 am
Reply with quote

you might be able to work some magic by using the retrieve information to find the last find issued. (though not sure how) just putting it out in case someone knows more.
Back to top
View user's profile Send private message
James Magruder

New User


Joined: 01 Nov 2008
Posts: 5
Location: Kansas City MO

PostPosted: Sun Nov 09, 2008 8:49 pm
Reply with quote

Apologies for the bad link. I'll be more careful next time.

Douglas Wilder, thanks for that comment about using * to repeat the previous string. That might work for me. (I've been using the ISPF editor for 20 years, and I didn't know about that.)

As for using Retrieve or RETP to get to the last FIND command, maybe I could make that work, but I'm curious now about where that Find information is stored. Seems like a VGET should be able to retrieve it... if I knew what it was called.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Nov 09, 2008 9:38 pm
Reply with quote

Hello,

This may be the same info you found earlier (i added the bold):
Quote:
USER_STATE—Save or Restore User State

z/OS V1R10.0 ISPF Edit and Edit Macros
SC34-4820-08

The USER_STATE assignment statement saves or restores the state of edit profile values, FIND, CHANGE, SEEK, and EXCLUDE values, and panel and cursor values.

Syntax

Assignment statement syntax

>>-ISREDIT--(varname)-- = --USER_STATE-------------------------><

>>-ISREDIT--USER_STATE-- = --(varname)-------------------------><

varname
The name of a variable to contain your status information.
Note:
The information in the variable is saved in an internal format that is subject to change. Dependence on the format can lead to macro errors.
Description


USER_STATE can be used at the beginning of a macro to save conditions, and at the end of a macro to restore the conditions that may have changed during processing. Many of the values saved by USER_STATE can be saved and restored individually. The USER_STATE assignment statement is a simple way of saving many values with a single statement.

These edit modes and values are saved and restored by USER_STATE:

AUTOLIST CURSOR NOTES RECOVERY
AUTONUM HEX NULLS STATS
AUTOSAVE IMACRO NUMBER TABS
BOUNDS MASKLINE PACK TABSLINE
CAPS MODEL CLASS PROFILE

Return codes

0 Normal completion
20 Severe error


Examples

To save the user state in variable &STATUS:

ISREDIT (STATUS) = USER_STATE To restore the user state from variable &STATUS:

ISREDIT USER_STATE = (STATUS)


If you are willing to deal with a "surprise" as part of an upgrade, you might try to dump &STATUS and see if it is usable for what you want.

I sent a note to one of my contacts and he replied that he didn't believe it was directly available to code.
Back to top
View user's profile Send private message
James Magruder

New User


Joined: 01 Nov 2008
Posts: 5
Location: Kansas City MO

PostPosted: Mon Nov 10, 2008 12:24 am
Reply with quote

Dick,

Thanks for the info. Yes, that's the USER_STATE doc that I tried to refer to earlier.

I'll try dumping the contents of USER_STATE. If I find anything interesting I'll report back. (And I'm aware that the format might change in the future.)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Nov 10, 2008 12:46 am
Reply with quote

You're welcome - good luck icon_smile.gif

d
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 Store the data for fixed length COBOL Programming 1
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts How to pass the PARM value to my targ... COBOL Programming 8
Search our Forums:

Back to Top