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

Call program, directly from panel


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

New User


Joined: 19 Oct 2022
Posts: 24
Location: Israel

PostPosted: Sun May 21, 2023 2:18 pm
Reply with quote

Hi all.
I have a basic rexx prog. lets call it prog01.
prog01 calls a basic panel. lets call it panel01.

in panel01, I have (lets say) 3 options - a, b, and c.
lets say I also have 3 basic rexx programs, progA, progB, progC.

and of-course, if i choose a, i want to call progA,
if I choose b, call progB etc..

The catch is, and what i can't figure out how to do,
is to call it DIRECTLY from the panel.

I want to call a REXX program, code, from a PANEL.
Not the code "behind" it (a.k.a. - prog01),
but DIRECTLY from the actual PANEL code.

How do I go about doing it?

Would appreciate any help,
Thanks.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10866
Location: italy

PostPosted: Sun May 21, 2023 2:59 pm
Reply with quote

www-40.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R4sc193619?OpenDocument

BTW... you do not call a panel, you DISPLAY it

and here the link to the list of ISPF manuals

www-40.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R4IspfPublications?OpenDocument
Back to top
View user's profile Send private message
RazVorox

New User


Joined: 19 Oct 2022
Posts: 24
Location: Israel

PostPosted: Sun May 21, 2023 3:35 pm
Reply with quote

As usual, even though your search skills are implacable, and your links are more than a blessed go-to, I was hopping for a more concise, specific answer. perhaps even a code line (god-forbid).

The option of re-taking, or re-visiting my old REXX course, even though a general good idea, would be less than productive atm.

So, while i DO thank you, you have not really answered my question, and more like.. sent me to google it.
A thing I could, and did - myself.

Z/OS is a dying community, and part of the reason is the lack of ppl sharing direct, relevant info. like on stackOverFlow, or our newest member - ChatGPT.

If you could help with a direct reference, or code line, or example - I would appreciate it. Otherwise.. The manual, I could skim myself in the next few days.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 701
Location: Denmark

PostPosted: Sun May 21, 2023 8:06 pm
Reply with quote

Sounds like you are looking for a selection panel.
Short sample:
Code:
 )Attr                                                 
   _ type(input ) color(turq  ) caps(on) hilite(uscore)
   ] type(output) color(blue  ) caps(on)               
   " type(text  ) color(blue  )                       
   + type(text  ) color(green)                         
   # type(text  ) color(yellow) caps(off)             
 )Body expand(\\)                                     
 "\ \Select pgm A-C\ \+                               
 %ISPFcmd ==>_zcmd \ \+  +                             
 +                                                     
 +                                                     
 +_z+Enter selection                                   
    %1+program a                                       
    %2+program b                                       
    %3+program c                                       
 +                                                     
 )Init                                                 
  .zvars = '(sel1)'                                   
 )Proc                                                 
  &zsel = Trans(&sel1 1,'Cmd(ZPgmA)'                   
                      2,'Cmd(ZPgmB)'                   
                      3,'Cmd(ZPgmC)'                   
          *,?)                                         
 )End                                                 
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 701
Location: Denmark

PostPosted: Sun May 21, 2023 8:10 pm
Reply with quote

Forgot to mention that a selection panel is started by the SELECT service, i.e. address ispexec "select panel(mypan1)"
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1935
Location: USA

PostPosted: Sun May 21, 2023 8:11 pm
Reply with quote

RazVorox wrote:
As usual, even though your search skills are implacable, and your links are more than a blessed go-to, I was hopping for a more concise, specific answer. perhaps even a code line (god-forbid).

The option of re-taking, or re-visiting my old REXX course, even though a general good idea, would be less than productive atm.

So, while i DO thank you, you have not really answered my question, and more like.. sent me to google it.
A thing I could, and did - myself.

Z/OS is a dying community, and part of the reason is the lack of ppl sharing direct, relevant info. like on stackOverFlow, or our newest member - ChatGPT.

If you could help with a direct reference, or code line, or example - I would appreciate it. Otherwise.. The manual, I could skim myself in the next few days.

Extremely rude response, and consists of stupid mantras of young newbie-geeks…
Sorry…
Back to top
View user's profile Send private message
RazVorox

New User


Joined: 19 Oct 2022
Posts: 24
Location: Israel

PostPosted: Sun May 21, 2023 8:41 pm
Reply with quote

First of all - Willy - Thanks.
That's -EXACTLY- what I meant, and - more specifically -, the part that I was missing was the "&zsel trans" part.
Thanks for the bullet :-)

Second - about "Rude".
Rude is not a "young" or "newbie" factor.
It's a human factor.

Having the knowledge and seniority does NOT justify attitude, bad manners, intonation, or general unpleasant conduct.

Again - this is meant as a place to share knowledge and help. not to bully, be condescending, or otherwise unpleasant or ego-trips. showing up over and over, calling everyone stupid, and sending them to a 300 page book, does not make you "smart". nor pleasant. nor humble.

You can help, without demeaning others, or the attitude.

This is not his first reply to me, or others, in that manner.
I am a senior, with over a decade in the open, I have done some pretty amazing stuff, and if you are looking for a "newbie" child to ego trip over... well.. That's not going to pass with me.

Sometimes, if you don't have anything to contribute, or nice to say, maybe you just shouldn't say anything.

Optional response the WOULD help, but also make me WORK for it, i.e., would be - "Look at the Selection panels again". or.. "Did you remember the &zsel = trans part" or any one out of a dozen other options.

"BTW... you do not call a panel, you DISPLAY it
and here the link to the list of ISPF manuals"
is the equivalent of saying - I know, you don't, go rtfm.
Thank you. I have done my summer semester on rexx.
Other wise I wouldn't be here.
That is not helping. that is sending me to @$@%.

so.. no. not RUDE. calling someone out on misconduct is standing up for yourself. you are looking for rude? - respect is to be earned. not forced upon.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sun May 21, 2023 10:52 pm
Reply with quote

| update: when I posted this, I was thinking of a compiled program,
| then realized the original post was about rexx. Use CMD() for rexx
| programs.

re:
Code:
&zsel = Trans(&sel1 1,'Cmd(ZPgmA)'                   
                      2,'Cmd(ZPgmB)'                   
                      3,'Cmd(ZPgmC)'   


It should be noted that programs called use the CMD() option are expecting the parameter list to be in a specific format. And, even though they are programs, they are more commonly referred to as TSO commands.

To call a batch program, use the PGM() option:
Code:
&zsel = Trans(&sel1 1,'PGM(ZPgmA)'                   
                      2,'PGM(ZPgmB)'                   
                      3,'PGM(ZPgmC)'   


The difference is subtle, so maybe you will not notice that there is a difference. The format of the parameter list is different.
Back to top
View user's profile Send private message
RazVorox

New User


Joined: 19 Oct 2022
Posts: 24
Location: Israel

PostPosted: Sun May 21, 2023 11:20 pm
Reply with quote

Thanks! Never thought of trying the tso option directly!!
It definitely opens up some new avenues..
I'll play around with it, see how it goes!!

(Eventualky, I'm gonna work with sup-c, so trying out
the different approaches, Code wise, between addressing
from rexx, and trying to call pgm,
Is exactly the kind of stuff i call fun :-)
Much appreciated!! )
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 701
Location: Denmark

PostPosted: Mon May 22, 2023 12:04 am
Reply with quote

You can actually run a program from a display panel, by using inline REXX, like so:
Code:
)Attr                                                 
  _ type(input ) color(turq  ) caps(on) hilite(uscore)
  ] type(output) color(blue  )                       
  # type(output) color(yellow)                       
  " type(text  ) color(blue  )                       
  + type(text  ) color(green)                         
)Body expand(\\)                                     
"\ \Select pgm A-C\ \+                               
%ISPFcmd ==>_zcmd \ \+  +                             
#err                                                 
+                                                     
+_z+Enter selection                                   
   %1+program a                                       
   %2+program b                                       
   %3+program c                                       
+                                                     
)Init                                                 
 .zvars = '(sel1)'                                   
)Proc                                                 
*REXX (*)                                             
 err=''                                               
 Select                                               
   when sel1='1' then Call @Echo 'A'                 
   when sel1='2' then Call @Echo 'B'                 
   when sel1='3' then Call @Echo 'C'                 
   otherwise err='Bad selection'                     
 End                                                 
*ENDREXX                                             
)End       

Inline REXX gives you much more control over your program calls.
Major difference is that a SELECTed panel stays active till you hit END or RETURN (or enter one of those commands), while a DISPLAYed panel terminates immediately whatever you press, unless of course you have some VERIFYs in there.
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 DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts COBOL program changes not showing up ... COBOL Programming 7
Search our Forums:

Back to Top