View previous topic :: View next topic
|
Author |
Message |
dinilp
New User
Joined: 17 Jan 2009 Posts: 3 Location: India
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
dinilp
New User
Joined: 17 Jan 2009 Posts: 3 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Cheers Enrico, the old dog learns another new trick |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Even with the new trick, I don't see how it will work.
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Anyway, it's good to know about these variables.
I'm sure there will be plenty of other opportunities to use them. |
|
Back to top |
|
|
dinilp
New User
Joined: 17 Jan 2009 Posts: 3 Location: India
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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.
Sorry for not being more explicit in previous posts! |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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: |
)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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Thanks.
I had tried with an external rexx program and could not get it to work. |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
I couldn't get an external program to work either. Display command() just didn't work out. |
|
Back to top |
|
|
|