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
 

 

How to get data from current line without using Edit Macro

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: How to get data from current line without using Edit Macro
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: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 09, 2010 8:12 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Mar 09, 2010 8:54 pm    Post subject: Reply to: How to get data from current line without using Ed
Reply with quote

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

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/ISPZPM61
http://www.sillysot.com/mvs
and the article Cursor-sensitive ISPF at
http://www.cbttape.org/xephon/xephonm/mvs9911.pdf and
http://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: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 09, 2010 9:21 pm    Post subject:
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: 1219
Location: Israel

PostPosted: Tue Mar 09, 2010 9:49 pm    Post subject: Reply to: How to get data from current line without using Ed
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Mar 09, 2010 10:00 pm    Post subject: Reply to: How to get data from current line without using Ed
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

Senior Member


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

PostPosted: Tue Mar 09, 2010 10:34 pm    Post subject: Reply to: How to get data from current line without using Ed
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: 1219
Location: Israel

PostPosted: Wed Mar 10, 2010 3:00 pm    Post subject: Reply to: How to get data from current line without using Ed
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    Post subject:
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: 1219
Location: Israel

PostPosted: Wed Mar 10, 2010 9:31 pm    Post subject:
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: 401
Location: Mumbai

PostPosted: Wed Mar 10, 2010 10:17 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Mar 11, 2010 2:11 am    Post subject: Reply to: How to get data from current line without using Ed
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: 401
Location: Mumbai

PostPosted: Thu Mar 11, 2010 4:28 am    Post subject:
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

Senior Member


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

PostPosted: Thu Mar 11, 2010 6:22 am    Post subject: Reply to: How to get data from current line without using Ed
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: 401
Location: Mumbai

PostPosted: Thu Mar 11, 2010 6:48 am    Post subject: Reply to: How to get data from current line without using Ed
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Unwrap the data based on delimiter X'25' bhavana yalavarthi DFSORT/ICETOOL 30 Fri Dec 09, 2016 10:25 am
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm


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