MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Setting error messages in a panel containing Rexx code

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 624
Topics: 175
Location: Stockholm, Sweden

PostPosted: Mon Oct 01, 2018 9:45 am    Post subject: Setting error messages in a panel containing Rexx code Reply with quote

Here's where I am at the moment. I have a simple panel that contains the following:-
Code:

)PROC                                                           
VER(&SECURE,NONBLANK,LIST,Y,N)  /* Y or N  */                   
VER(&MINIMUM,NONBLANK,LIST,Y,N)  /* Y or N  */                 
VER(&PRODBUG,NONBLANK,LIST,Y,N)  /* Y or N  */                 
                                                               
*REXX(PRODBUG,TFSNR)                                           
select                                                         
  when prodbug = 'N' then                                       
    ZRXRC = 0                                                   
  when tfsnr <> '' then                                         
    ZRXRC = 0                                                   
  otherwise                                                     
    do                                                         
      /* Note that these DON'T need to be defined as */         
      /* arguments/variables when passed to this Rexx script */
      ZRXMSG = 'GDPR001'                                       
      ZRXRC = 8                                                 
    end                                                         
end                                                             
*ENDREXX                                                       

My message file that is allocated when the script showing the panel is defined as:-
Quote:

GDPR001 'TFS number required ' .TYPE=WARNING
'You MUST specify a TFS number when copying because of ' +
'production defect'


Now, I'll be quite honest, I'm not a great fan of these sorts of ISPF messages. Normally, in my Rexx script, I prefer to write them as something like:-
Code:

/**********************************************************************
                                                                       
**********************************************************************/
dsorg_not_found:                                                       
arg dataset                                                           
zedsmsg = ""                                                           
zedlmsg = "Dataset "dataset" not found - create it first"             
rc = ISPFMSG()                                                         
return 0                                                               
/**********************************************************************
 Show info/error messages to user                                     
**********************************************************************/
ISPFMSG:                                                               
zcmd = ''                                                             
Address ISPEXEC                                                       
'VPUT (ZCMD,ZEDSMSG,ZEDLMSG)'                                         
'SETMSG MSG(ISRZ001)'                                                 
Return 0                                                               

What I'm wondering is if there is a way of issuing the message via the Rexx in the panel - something possibly like this:-
Code:

*REXX(PRODBUG,TFSNR)                                           
select                                                         
  when prodbug = 'N' then                                       
    ZRXRC = 0                                                   
  when tfsnr <> '' then                                         
    ZRXRC = 0                                                   
  otherwise                                                     
    do                                                         
        zerrsm = "short message text"  <--------- something like this
        zerrlm = "long message text"    <--------- would be nice if possible
        ZRXRC = 8                                                 
    end                                                         
end                                                             
*ENDREXX     

_________________
Michael
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Mon Oct 01, 2018 11:02 am    Post subject: Reply with quote

misi01,

You almost got it with zerrsm and zerrlm

something like this

Code:

if rc = 0 then do
   zerrsm = "Short message text"
   zerrlm = "long message text",
                      " continued on next line."
   "SETMSG MSG(ISRZ002)"
   "DISPLAY PANEL(your panel name)"
   end


You can also check the following topic

http://www.mvsforums.com/helpboards/viewtopic.php?t=3947
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 624
Topics: 175
Location: Stockholm, Sweden

PostPosted: Tue Oct 02, 2018 12:22 am    Post subject: Reply with quote

I think (?) there was a misunderstanding in how you read my situation. I changed the code to the following
Code:

*REXX(PRODBUG,TFSNR)                                             
select                                                           
  when prodbug = 'N' then                                       
    ZRXRC = 0                                                   
  when tfsnr <> '' then                                         
    ZRXRC = 0                                                   
  otherwise                                                     
    do                                                           
      /* Note that these DON'T need to be defined as */         
      /* arguments/variables when passed to this Rexx script */ 
      /* ZRXMSG = 'DIAL01A' */                                   
      /* RC = 8 */                                               
      zerrsm = "Short message text"                             
      zerrlm = "long message text continued on next line."       
      "SETMSG MSG(ISRZ002)"                                     
      "DISPLAY PANEL(GDPR0001)"                                 
    end                                                         
end                                                             
*ENDREXX                                                         

and received the following errors
Quote:

COMMAND SETMSG NOT FOUND
25 *-* "SETMSG MSG(ISRZ002)"
+++ RC(-3) +++
SYMBOLIC PARMS IN VALUE LIST IGNORED - PANEL(GDPR0001)+
COMMAND PROCEDURE HAS NO PROC STMT
ISPF service call not allowed during exit invocation.



Remember, the Rexx code is in the actual panel and not in a Rexx script driving the panel.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Tue Oct 02, 2018 12:55 am    Post subject: Reply with quote

Isn't RC(-3) to do with the ISPF environment - he says from memory as I haven't logged onto TSO in four years Confused
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Oct 02, 2018 4:01 am    Post subject: Reply with quote

Try
Quote:
ADDRESS ISPEXEC(...

_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 624
Topics: 175
Location: Stockholm, Sweden

PostPosted: Mon Oct 08, 2018 2:36 am    Post subject: Reply with quote

Nic - I assume you were thinking of something like this ?

Code:

    CSR = 'TFSNR'                                           
    /* ZRXMSG = 'DIAL010A'                                      */
     zedsmsg = "Unbalanced strings"                         
     zedlmsg = "Your code contains unbalanced code"
     zcmd = ''                                             
    Address ISPEXEC */                                   
     'VPUT (ZCMD,ZEDSMSG,ZEDLMSG)' */                     
       'SETMSG MSG(ISRZ001)'                           
    ZRXRC = 8                                               

which gave the following
Quote:

28 *-* zcmd = ''
>L> ""
29 *-* Address ISPEXEC
30 *-* 'VPUT (ZCMD,ZEDSMSG,ZEDLMSG)'
>L> "VPUT (ZCMD,ZEDSMSG,ZEDLMSG)"
+++ RC(-3) +++
31 *-* 'SETMSG MSG(ISRZ001)'
>L> "SETMSG MSG(ISRZ001)"
+++ RC(-3) +++


I then tried variations on this but haven't been able to get anything to work.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Oct 08, 2018 5:07 am    Post subject: Reply with quote

This is my reference snippet:
Code:

Do                                                                             
   zedsmsg = "LIBRARY ERROR"                                                   
   zedlmsg = source.count "ERROR"                                               
   "ISPEXEC SETMSG MSG(ISRZ000)"                                               
   Exit                                                                         
End                                                                             

but this is for a rexx program not a panel edit rexx. I do not even know if you can do this in "panel" rexx. It was just a blind guess without referencing the appropriate manual.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Steve Coalbran
Beginner


Joined: 09 Mar 2005
Posts: 22
Topics: 0
Location: Stockholm, Sweden

PostPosted: Wed Oct 10, 2018 12:08 am    Post subject: Reply with quote

You cannot issue ISPF Services within a REXX section.
Something more like this I do a lot... this is not taken from a live example so may be typos!
Code:
&ZERRSM = ''
&ZERRLM = ''
&ZERRHM = 'NONE'
&ZERRALRM = 'YES'
*REXX(*,ZERRSM,ZERRLM,...)
 zerrsm = '...'
 zerrlm = '...'
*ENDREXX
IF( &ZERRSM NE '') .MSG = ISRZ002
Cool
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Steve Coalbran
Beginner


Joined: 09 Mar 2005
Posts: 22
Topics: 0
Location: Stockholm, Sweden

PostPosted: Wed Oct 10, 2018 12:53 am    Post subject: Reply with quote

Steve Coalbran wrote:
Beginner Cool

Just spotted my 'level': 'Beginner'
I think in IBM UK Portsmouth Northern Road, we started with ISPF in 1979 and I worked with CLISTs writing dialogues as soon as I discovered them.
Migrated to REXX as soon as it became available on TSO.
I have developed in it most of the time since then except for a year when I migrated to Sweden when I played with UNIX briefly.
Perhaps 'Beginner' is a little inaccurate? Rolling Eyes
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Oct 10, 2018 1:54 am    Post subject: Reply with quote

Steve, you have to turn up every day and give teacher an apple to get past beginner Very Happy
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Wed Oct 10, 2018 11:15 am    Post subject: Reply with quote

Steve Coalbran wrote:
Steve Coalbran wrote:
Beginner Cool

Just spotted my 'level': 'Beginner'
I think in IBM UK Portsmouth Northern Road, we started with ISPF in 1979 and I worked with CLISTs writing dialogues as soon as I discovered them.
Migrated to REXX as soon as it became available on TSO.
I have developed in it most of the time since then except for a year when I migrated to Sweden when I played with UNIX briefly.
Perhaps 'Beginner' is a little inaccurate? Rolling Eyes


Steve,

I apologize for the "beginner" tag, As Nic kindly pointed out the software is designed to assign ranks based on how many posts you posted. You have been a miser on that front. Laughing You just have 22 posts since 2005. So You may want to share all your knowledge that you gained since 1979. Smile

Btw you are more than welcome to choose your own title and I will more than happy to add it. Would the title "Dinosaur" be any better than "Beginner"? Personally I prefer having the title as "beginner" so that I can always learn something new every day.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 624
Topics: 175
Location: Stockholm, Sweden

PostPosted: Thu Oct 11, 2018 2:07 am    Post subject: Reply with quote

I think I'm going to have to go with that what I wanted to do (from the first append) isn't doable.

I found the following link https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.f54dg00/ispdg180.htm which talks about setting ZRXMSG and
ZRXRC.

If I comment out the setting of ZRXMSG, then I get "Rexx-defined failure" (SMSG) and "Panel Rexx routine-defined failure" (LMSG), so I think the long and the short of it is that you have to set ZRXMSG and ZRXRC
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group