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

Invoking a rexx exec


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

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Thu Oct 08, 2009 7:43 pm
Reply with quote

Hi,

Can I invoke a Rexx Exec by giving the exec name when I am in the ISPF primary option menu?

Lets say I want to excecute ;start 3.4 when I invoke an exec called Example when I am in ISPF primaru Menu. If it is possible could some one give me a sample Rexx code?

Thank you..
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Oct 08, 2009 7:55 pm
Reply with quote

sathyaraj wrote:
If it is possible could some one give me a sample Rexx code?

This is a HELP forum, not a do it for me forum.

What have you tried yourself and what errors have you encountered.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Oct 08, 2009 8:22 pm
Reply with quote

expat, calm...

There is nothing wrong with asking for an example. The fellow is trying to learn to use a tool. If a budding surgeon asked to see how to use a scalpel, or a wannabe woodworker asked to see how to use a table saw, you wouldn't say "try it yourself and show me what you've done". You'd only end up with a mess (lots of blood for no benefit).


sathyaraj. Your question isn't quite clear. There are ways to invoke execs on any ISPF panel by just typing in the command (look for "command tables") but that is not common. Generally you invoke the Rexx exec by typing TSO followed by the exec name and its parameters.

There also seems to be some confusion about the START command. That is not a rexx exec, it is a built in ISPF command. You can invoke it from REXX though. Look at this article that I found searching Google for ISPSTRT
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Oct 08, 2009 8:42 pm
Reply with quote

Of course, when someone states in their profile these facts:

Occupation: Programmer Analyst.
Mainframe Skills: REXX,COBOL,JCL,VSAM,CICS

Then I think we all can reasonably expect a higher level of the basic knowledge, although I'm noticing that TSO and ISPF are missing from the skillset, so maybe the OP doesn't normally use either.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri Oct 09, 2009 1:18 pm
Reply with quote

MBabu wrote:
expat, calm...
There is nothing wrong with asking for an example.

I agree, but certainly AFTER the OP has done some research for themselves.

What was to stop the OP from using google or whatever to find the exact same thread that you did.

Oh, and thanks for the thread, it is good.
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Fri Oct 09, 2009 4:15 pm
Reply with quote

Sorry everyone...

I din mean you to do the work for me.. I dont have internet conenctivity at my workplace.. I was at my home when I posted the message and couldn get my hands on a Pcomm to get you the code details that I had..

address "ISPEXEC"
"SELECT PGM(ISPSTRT) PARM(3.4) SCRNAME(DSLIST)"
"SELECT PGM(ISPSTRT) PARM(S.ST) SCRNAME(SDSF)"

This was exactly what I was looking for.. Created this EXEC.. but was not sure how to invoke the same.. Will try the Command tables..

Thanks a lot..
Back to top
View user's profile Send private message
ShameemOracle

New User


Joined: 23 Sep 2009
Posts: 15
Location: bangalore

PostPosted: Tue Oct 13, 2009 11:12 am
Reply with quote

Quote:
Created this EXEC.. but was not sure how to invoke the same


Looking at your post I suppose your requirement is to invoke your piece of REXX code from an ISPF panel.. right ?

you have to modify your panel definition to invoke your rexx. In the panel definition you can call your REXX pgm like below
Code:
2,'CMD(%TEST3) SCRNAME(TCPIPNPF)'

Where TEST3 is the REXX having your code
address "ISPEXEC"
"SELECT PGM(ISPSTRT) PARM(3.4) SCRNAME(DSLIST)"
"SELECT PGM(ISPSTRT) PARM(S.ST) SCRNAME(SDSF)"

The panel definition follows [Take care of non printable chars while copy paste]
Code:
)PANEL KEYLIST(ISRSNAB,ISR)                                             
)ATTR DEFAULT(   ) FORMAT(MIX)            /* TEST3 - ENGLISH - 5.6 */   
 0D TYPE(PS)                                                           
 05 TYPE(PT)                                                           
 09 TYPE(FP)                                                           
 0A TYPE(NT)                                                           
 11 TYPE(SAC)                                                           
 26 TYPE(NEF) CAPS(ON) PADC(USER)                                       
 27 AREA(SCRL) EXTEND(ON)                                               
 28 TYPE(PS) CSRGRP(99)                                                 
)BODY  CMD(ZCMD)                                                       
                   Shameem's TEST Primary Option Menu                   
 Option ===> Z                                                         
 SAREA39                                                               
)AREA SAREA39                                                           
 1  GDDM PQM      GDDM Print Queue Manager                             
 2  Shamim P02    Invokes REXX R17057.REXX(TEST3)                       
 3  TASID 5.17    IBM TASID Version 5.17                               
)INIT                                                           
.ZVARS = '(ZCMD)'                                               
.HELP = ISR00003                                               
)PROC                                                           
&ZCMDWRK = &Z                                                   
IF (&ZCMD ¬= &Z)                                               
  &ZCMDWRK = TRUNC(&ZCMD,'.')                                   
  &ZTRAIL=.TRAIL                                               
  IF (&ZCMDWRK = &Z)                                           
    .MSG = ISRU000                                             
&ZSEL = TRANS (TRUNC (&ZCMD,'.')                               
  1,'CMD(ADMPQM) SCRNAME(GDDMPQM)'                             
  2,'CMD(%TEST3) SCRNAME(TCPIPNPF)'                             
  3,'PGM(TASID0) SCRNAME(SHAMEEM) NOCHECK'                     
  X,EXIT                                                       
 ' ',' '                                                       
   *,'?')                                                       
)END                                                           



The panel will look like this
Code:
                  Shameem's TEST Primary Option Menu                           
Option ===>                                                                   
                                                                               
1  GDDM PQM      GDDM Print Queue Manager                                     
2  Shamim P02    Invokes REXX R17057.REXX(TEST3)                               
3  TASID 5.17    IBM TASID Version 5.17                                       


Remember: your REXX libarary say R17057.REXX which contains TEST3 and panel libarary say R17057.SISPPENUwhich contains panel should be included in ISPF library concatenations ISPPLIB and SYSEXEC.

Feel free to ask if you need any more help on this.
Back to top
View user's profile Send private message
ShameemOracle

New User


Joined: 23 Sep 2009
Posts: 15
Location: bangalore

PostPosted: Tue Oct 13, 2009 11:36 am
Reply with quote

I would like to add two more points to my previous posts which came to my mind later.

1) instead of using numbers if you need you can use the EXEC name in the Panel choice. ie
instead of
Code:
2,'CMD(%TEST3) SCRNAME(TCPIPNPF)'

you can use
Code:
TEST3,'CMD(%TEST3) SCRNAME(TCPIPNPF)'


2) After addeing the REXX libarary say R17057.REXX which contains TEST3 to SYSPROC or SYSEXEC concatenation. you can invoke the rexx TEST3 from any ISPF panel like below
Code:
TSO TEST3
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Oct 13, 2009 4:41 pm
Reply with quote

From what I make of your original request, you want to type TSO execname on the primary option menu and execute an exec to open another screen.

From the example given to you by MBabu, place the code into an ISPF concatenated library, either concatenated to SYSEXEC or SYSPROC and type TSO execname on the command line.

If the library is not ISPF concatenated, the ntype TSO EXEC 'library name(execname)' on the command line and it will work.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Oct 22, 2009 6:18 am
Reply with quote

I like this approach:
- have input field for command in the body of the menu
- user types name of command in field, then
- user types menu selection number (2 in example)
- panel executes the command, no matter what name
- command name is saved in profile, for next time panel is shown

The panel can be shared among various users and each one can invoke their own command.

This is a modified version of ShameemOracle panel
Code:
)BODY  CMD(ZCMD)                                                       
                   Pedro's Original Option Panel (POOP)                   
 Option ===> Z                                                         
 SAREA39                                                               
)AREA SAREA39       \
 2  User Command    Invokes. ._USRCMD     +
 3  TASID 5.17    IBM TASID Version 5.17                               
)PROC                                                           
&ZCMDWRK = &Z                                                   
IF (&ZCMD ¬= &Z)                                               
  &ZCMDWRK = TRUNC(&ZCMD,'.')                                   
  &ZTRAIL=.TRAIL                                               
  IF (&ZCMDWRK = &Z)                                           
    .MSG = ISRU000                                             
&ZSEL = TRANS (TRUNC (&ZCMD,'.')                   
  2,'CMD(&USRCMD) SCRNAME(USRCMD)'                                             
  X,EXIT                                                       
 ' ',' '                                                       
   *,'?')     

VPUT (USRCMD) PROFILE                                                 
)END                         
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
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
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top