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

Initial macro problem screwing up FIND/RFIND


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

Senior Member


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

PostPosted: Mon May 11, 2009 6:23 pm
Reply with quote

Hi all,

At my current employer the final qualifier of datasets is either SAM or PDS, to designate sequential datasets and PDS'es. As a consequence every FB 80 PDS uses the same edit profile, which is not very useful with regard to the setting of tabs, bounds and hilighting.

To stop me getting mad, I've written an initial macro to more-or-less mimics the auto-language selection, as used by the HI command, to determine the language and set the profile accordingly, and that's where I've run into a problem with the 'USER_STATE'.

If I'm in a memberlist, edit or view a member, do a "f 'whatever'", leave, select another member, and do an RFIND, it will again try to find 'whatever'. However, if I do the same thing from the main Edit or View panel, the RFIND will go for either 'dcl' or ' then ', the two keywords I use to detect PL/I, DESPITE the fact that the two find's are bracketed by a save and restore of the USER_STATE. Stranger yet, while tracing the initial macro, USER_STATE does NOT contain 'whatever'. If I disable the initial macro, do a find 'whatever' in mem1, and follow that by an RFIND in mem42, 'whatever' is found, but again it is NOT in the USER_STATE.

Even stranger is this behaviour, with the initial macro disabled, so anyone should be able to repeat:

1) edit/view a member or dataset
2) f 'a string like lalala'
3) run the macro below

Code:

/* REXX */
"isredit macro"
"isredit (S) = user_state"
say s
exit


and somewhere your screen you'll see 'A STRING LIKE LALALA'

4) edit/view an non-existing (new) member
5) run the macro and see anything, EXCEPT 'A STRING LIKE LALALA'
6) do an argumentless RFIND
7) run the macro, and miraculously, 'A STRING LIKE LALALA' is back.

Where did ISPF get it from, and how do I get at it to stop my initial macro from screwing up the find string.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue May 12, 2009 10:51 am
Reply with quote

Take a look at the ISPF variable ZINSTR1.

O.
Back to top
View user's profile Send private message
prino

Senior Member


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

PostPosted: Tue May 12, 2009 10:58 am
Reply with quote

And where would I find this variable that is not in any variable pool and even unknown to Google?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue May 12, 2009 12:13 pm
Reply with quote

I'm seeing it when I'm using Dialog Test (in the LOG dataset).

O.
Back to top
View user's profile Send private message
prino

Senior Member


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

PostPosted: Fri May 15, 2009 11:34 am
Reply with quote

The following code (z/OS 01.09.00, ISPF 5.9.0) is able to set up a working version of the edit 'USER_STATE' data for use in initial macros:

Code:

/* REXX edit macro to set up partial USER_STATE                       */
"isredit macro"
"isredit (STATE) = user_state"
 
/***********************************************************************
* Find ISPF control block for this screen                              *
***********************************************************************/
$tcb  = storage(21c, 4)
$grs9 = storage(d2x(c2d($tcb) + 84), 4)
 
do until storage(c2x($grs9), 3) = 'TLD' ! c2d($tcb) = 0
  $tcb  = storage(d2x(c2d($tcb) + 132), 4)
  $grs9 = storage(d2x(c2d($tcb) +  84), 4)
end
 
/***********************************************************************
* Area of 1024 bytes @ x'1b00' contains lot of edit data               *
***********************************************************************/
flc  = storage(d2x(x2d(c2x($grs9)) + x2d(1b5a)), 2)  /* FIND   length */
clc  = storage(d2x(x2d(c2x($grs9)) + x2d(1b62)), 2)  /* CHANGE length */
fs   = storage(d2x(x2d(c2x($grs9)) + x2d(1cf0)), 256)/* FIND   string */
cs   = storage(d2x(x2d(c2x($grs9)) + x2d(1df0)), 256)/* CHANGE string */
fcx  = storage(d2x(x2d(c2x($grs9)) + x2d(1b52)), 1)  /* FIND/CHNG/EX  */
ftx  = storage(d2x(x2d(c2x($grs9)) + x2d(1b53)), 1)  /* c'/t'/x'/p'   */
zf   = storage(d2x(x2d(c2x($grs9)) + x2d(1bf8)), 8)  /* Top range lab */
zl   = storage(d2x(x2d(c2x($grs9)) + x2d(1c01)), 8)  /* Bot range lab */
xnx  = storage(d2x(x2d(c2x($grs9)) + x2d(1b70)), 8)  /* X'ED/NON-X'ED */
afln = storage(d2x(x2d(c2x($grs9)) + x2d(1b68)), 8)  /* All/First/etc */
ps   = storage(d2x(x2d(c2x($grs9)) + x2d(1b66)), 1)  /* Pre/Suf/etc   */
 
state = overlay(flc,  state,  51)
state = overlay(clc,  state,  59)
state = overlay(fs,   state, 225)
state = overlay(cs,   state, 481)
state = overlay(fcx,  state,  43)
state = overlay(ftx,  state,  44)
state = overlay(zf,   state, 209)
state = overlay(zl,   state, 217)
state = overlay(xnx,  state,  73)
state = overlay(afln, state,  65)
state = overlay(ps,   state,  63)
 
"isredit user_state = (STATE)"


The 'afln' string is OK, but it seems to need more info to actually make the Find/Change/Exclude work as expected, left up to the user to figure that out.
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 To find whether record count are true... DFSORT/ICETOOL 6
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts PRINTOUT macro PL/I & Assembler 0
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
Search our Forums:

Back to Top