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

Invoking REXX from ISPF command line and EDIT/VIEW sessions


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

New User


Joined: 16 Oct 2008
Posts: 74
Location: Boston

PostPosted: Fri Mar 02, 2012 6:06 pm
Reply with quote

Hi,
I am very new to REXX and for a beginner, I started to incorporate my learning into a small program. I have created a tool that would actually open up an element if it is in a set of libraries that I have pre-defined.
Say for example, I have a statement in my JCL like CNTLCARD(abcd1), it would check if the element ‘abcd1’ exists in the predefined library or not. If yes, it would open up or else it will display a message. For this, I have created a Macro and so I invoke it without a 'TSO' preceding it.

Now, I have created a second tool which gets the argument from the user on the command line and does the same kind of check and opens the element for him. But this time I get it thru an ARG and I invoke it with the 'TSO' Preceding.
Code:

arg userentry                         
PARSE VAR userentry element1 ' ' type1

In an effort to integrate them into a single tool as most of the logic is similar except that one is from a specific line in my editor session and the other is from the command line, I am failing pathetically.

I partially had a resolution when I used the below code
Code:

 ADDRESS ISREDIT "MACRO (ELEMENT1,TYPE1)" NOPROCESS
"ISREDIT (ROWLINE) = LINE .ZCSR"           

And I had a logic which would process the record as Argument if Element1 >' ' or else it would process it as a line in my editor session.

But the problem was that, it works only when opened inside a edit/view session.
The whole idea is a single function key(which I would set for this tool) for all my element navigation. Can this be done? Or should they exist as two different entities? Any help in this regard would be greatly appreciated.

Thanks,
Ashwin.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Mar 02, 2012 6:13 pm
Reply with quote

Quote:
Can this be done? Or should they exist as two different entities? Any help in this regard would be greatly appreciated.


whatever You meant can probably be done but ...
your explanation was clear as mud.
so based on Your explanation we just can tell nada


but since today is friday ( half psychic day )
maybe You meant something like a zoom macro ...
it has already been written and posted ( search for it in the forums )
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 74
Location: Boston

PostPosted: Fri Mar 02, 2012 8:37 pm
Reply with quote

Thanks enrico. Let me try to explain in a better way

Its quite similar to the zoom macro you mentioned. Like reading the cursor position(ROWLINE) and trying to open a particular member in a pds based on that.

In addition I want it to accept a string on the command line and try to open that member from those PDSs.

So I had the below code in place...

Code:

ADDRESS ISREDIT "MACRO (ELEMENT1)" NOPROCESS
"ISREDIT (ROWLINE) = LINE .ZCSR"   

IF ELEMENT1 > ' ' THEN
   PROCESS IT AS ARGUMENTS
ELSE
   PROCESS IT AS ROW LINE


I had my pf2 key set to this macro name. And when I give a member name(say ABCD) on the command line and press pf2 key it would search ABCD in the list of PDSs, ELSE it would read my cursor position and pick the member name and search the libraries.

Everything works fine when I am in a edit/view session. But does not work elsewhere.

1. Is it possible to have this macro invoked from the ISPF command line also is my first question?

2. If not, I can have the ROWLINE logic as a macro and Command line logic as a REXX program(where I would get the user value by coding ARG ELEMENT1). Is it possible that these two can be invoked from another REXX/MACRO which I can configure to my pf2 key now. Ultimately a single tool for two functions.

I know am shooting in the dark and my explanation might be mud again with a week's knowledge in REXX now. icon_rolleyes.gif
But any of your inputs in this regard is invaluable.

Thanks,
Ashwin.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Fri Mar 02, 2012 9:37 pm
Reply with quote

Edit macros can only work in Edit or View. They cannot be used on other ISPF panels.

To implement cursor-sensitive functionality on other ISPF panels requires a different technique. Look up ZSCREENI and ZSCREENC in the ISPF Dialog Developers Guide for more information.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat Mar 03, 2012 2:53 am
Reply with quote

Code:
ADDRESS ISREDIT "MACRO (ELEMENT1,TYPE1)" NOPROCESS


You cannot issue ISREDIT stuff outside of the editor / view. Look at the return code and process accordingly.
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top