Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Initial macro problem screwing up FIND/RFIND

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1002
Location: Oostende, Belgium

PostPosted: Mon May 11, 2009 6:23 pm    Post subject: Initial macro problem screwing up FIND/RFIND
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: 2360
Location: Israel

PostPosted: Tue May 12, 2009 10:51 am    Post subject:
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: 1002
Location: Oostende, Belgium

PostPosted: Tue May 12, 2009 10:58 am    Post subject:
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: 2360
Location: Israel

PostPosted: Tue May 12, 2009 12:13 pm    Post subject:
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: 1002
Location: Oostende, Belgium

PostPosted: Fri May 15, 2009 11:34 am    Post subject: Reply to: Initial macro problem screwing up FIND/RFIND
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us