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

How to get data from current line without using Edit Macro


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dinilp

New User


Joined: 17 Jan 2009
Posts: 3
Location: India

PostPosted: Tue Mar 09, 2010 7:49 pm
Reply with quote

Hi,

I need to develop a rexx code to automatically branch to a cobol section when the code is viewed on Endevor.
For eg:

.........

PEFRORM A100-PARA.

..........

A100-PARA.

when the cursor is on the 'PERFORM A100-PARA' line this rexx code should be invoked so that it automatically point to the actual cobol paragraph down the line.

I'm stuck in the initial stage itself because I am not getting how to retrieve
the data from the current line without using ISPF edit macros. Why i can't use Edit macros is because in Endevor the source listing opens in Browse mode.

Can anyone please help?
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Mar 09, 2010 8:12 pm
Reply with quote

I did hope that ZSCREENI might have shown the cursor position, but it didn't. Unfortunately I think this may be the end of the road as there is no such animal that I know of called a browse macro.

How about a quick word with your endevor people to see if the screen can be opened in VIEW mode instead.
Back to top
View user's profile Send private message
dinilp

New User


Joined: 17 Jan 2009
Posts: 3
Location: India

PostPosted: Tue Mar 09, 2010 8:45 pm
Reply with quote

I had contacted them earlier and they have told that you can specify the options to open the code in view mode.. But i want this rexx to be installed systemwide and all of the system users (including me:)) prefer to open endevor elements in browse mode only.

Isn't there any command in rexx to capture the data present in the current line?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Mar 09, 2010 8:54 pm
Reply with quote

search the ISPF manuals for
ZSCREENI ( screen content)
ZSCREENC ( cursor position )

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/ISPZPM61
www.sillysot.com/mvs
and the article Cursor-sensitive ISPF at
www.cbttape.org/xephon/xephonm/mvs9911.pdf and
www.cbttape.org/xephon/xephonm/mvs9912.pdf for the second part
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Mar 09, 2010 9:21 pm
Reply with quote

Cheers Enrico, the old dog learns another new trick icon_biggrin.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Mar 09, 2010 9:49 pm
Reply with quote

Even with the new trick, I don't see how it will work. icon_question.gif
Being in BROWSE, it cannot be a macro, it has to be a TSO command.
How will this command interact with BROWSE ??
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Mar 09, 2010 10:00 pm
Reply with quote

it works, not as an edit macro but, as a generic ISPF application
oops oops opps... I see what You mean

but even if useless my suggestion was technically correct icon_biggrin.gif
the ts asked How to get data from current line without using Edit Macros
and mi links showed how
that's ... one small step at the time approach
next time

like the joke of the tenant and the landlord
the landlord was called to visit the apartment
and the tenant showed a bunch of rats jumping around,
suddenly a frog jumped on the table
and the landlord ... that' s a frog, not a rat
the tenant ... lets' finish with the rats tonight, we' ll talk about humidity tomorrow
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Mar 09, 2010 10:34 pm
Reply with quote

I am not familiar with Endevour...

But the normal browse panel has the dataset name at the top. I think you can use ZSCREENI and ZSCREENC to determine the target, then launch VIEW for the same dataset and within VIEW, go to that target line.

Its sort of awkward because you have to close the VIEW and then close BROWSE when you are done.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Mar 10, 2010 3:00 pm
Reply with quote

Anyway, it's good to know about these variables.
I'm sure there will be plenty of other opportunities to use them. icon_smile.gif
Back to top
View user's profile Send private message
dinilp

New User


Joined: 17 Jan 2009
Posts: 3
Location: India

PostPosted: Wed Mar 10, 2010 5:39 pm
Reply with quote

Hi,
Thanks to all so that i could make this much progress..

so far, I am able to get the paragraph name by making use of
ADDRESS ISPEXEC
'VGET (ZSCREENI,ZSCREENC,ZENVIR)'
TEXT=SUBSTR(ZSCREENI,1,ZSCREENC)

and going further with string manipulations to get the name of the paragraph being performed.

Now, to branch to that location in the code, I intend to run a find command
as 'FIND paraname 25' since it always resides in 25th column for us..

But how do i execute this in the BROWSE mode?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Mar 10, 2010 9:31 pm
Reply with quote

dinilp wrote:
But how do i execute this in the BROWSE mode?

That is exactly what I meant when I asked:
Marso wrote:
How will this command interact with BROWSE ??

to which Enrico answered:
enrico-sorichetti wrote:
oops oops opps...


It became obvious to us that there is no know way to send the FIND command to the BROWSE program. icon_sad.gif

Sorry for not being more explicit in previous posts!
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Wed Mar 10, 2010 10:17 pm
Reply with quote

well, technically, you can do it by changing the browse panel that displays the data, but that is an alteration to either ISPF or Endevor code an your shop probably won't approve of that.

The change is panel logic to invoke a rexx panel exit that searches the screen, then sets zcmd with a FIND command and then does .RESP=ENTER. Not a lot of code (about 10-15 lines if I were to guess), but not likely to be accepted as a site wide change because of support issues.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Mar 11, 2010 2:11 am
Reply with quote

Quote:
you can do it by changing the browse panel


Agree. It seems simple enough. I had tried to do that yesterday, but I could not get the second invocation of the panel to process the command. If you have a working example, please show us.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Mar 11, 2010 4:28 am
Reply with quote

Changed panel ISRBROBA so that if you type 'ff' on the command line and move the cursor over data, it finds the word the cursor is over (say xxx) and issues
Code:
FIND "xxx." FIRST

Code:
)PROC                                                                   
&ZCURSOR = .CURSOR                                                     
&ZCSROFF = .CSRPOS                                                     
VPUT (ZSCBR) PROFILE     /*                           */               
&ZLVLINE = LVLINE(ZDATA)                                               
if (&ZCMD = 'FF' or &ZCMD = 'ff')                                       
 &CMDD='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
 *REXX(CMDD,ZSCREENC,ZSCREENI)                                         
 trtable='abcdefghijklmnopqrstuvwxyz'   /* Setup valid varname chars  */
 trtable=trtable||translate(trtable)||'1234567890-'                     
 trtable=translate(xrange('00'x,'FF'x),,trtable,' ')                   
 zscreeni=translate(zscreeni,,trtable,' ') /* Remove non-varname chars*/
 If substr(zscreeni,zscreenc+1,1) <> ' ' Then                           
   Do                                   /* Extract varname from screen*/
     name=word(substr(zscreeni,1+lastpos(' ',zscreeni,zscreenc)),1)     
     name=translate(strip(name))                                       
     cmdd='FIND "'name'." FIRST'                               
   End                                                                 
 *ENDREXX                                                               
 &ZCMD = &CMDD                                                         
 .RESP=ENTER                                                           
)END                                                                   
This wasn't really tested well or anything, but the idea is sound. Note indentation is important. This is an imperfect solution for many, many reasons but the example just satisfies the immediate question Pedro asked.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Mar 11, 2010 6:22 am
Reply with quote

Thanks.

I had tried with an external rexx program and could not get it to work.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Mar 11, 2010 6:48 am
Reply with quote

I couldn't get an external program to work either. Display command() just didn't work 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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts To get the the current time DFSORT/ICETOOL 13
Search our Forums:

Back to Top