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

Displaying Error Messages in Panels


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

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Mon Apr 28, 2008 11:41 am
Reply with quote

Am designing a screen to get the input from the user, validate it and process further if the input is correct and display an error message if its wrong on the panels

Can anyone tell me how to pop up these error messages in panels?

Can you please let me know the correct use of ZMSG, LMSG, SMSG, Zedsmsg, Zedlmsg. I couldn't get the exact meaning of what are all these and how it is being used (an example it will be of great use).

Any help on these will be really greatful.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Apr 28, 2008 12:48 pm
Reply with quote

Code:
zerrsm = "short message text"
zerrlm = "long message text"
Address ISPEXEC  "SETMSG MSG(ISRZ002) "


self explanatory isn' t it
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Tue Apr 29, 2008 10:41 am
Reply with quote

Hi,

Thanks for the reply

I would like to know how can these varibales can be used in actual programming and the real use of it.

For Example:

My panel is to get the input from the user validate it in rexx and trow the message accordingly

Say the panel is like this

Enter your Emp ID : _____________

say the user enters AAAAA

I need to validate in REXX and pop up a message saying

" Enter a valid Emp ID"

how can this be done.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Apr 29, 2008 11:41 am
Reply with quote

why not look at the manuall Yourself...
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ispzdg60/9.0?ACTION=MATCHES&REQUEST=setmsg&TYPE=FUZZY&SHELF=ISPZPM61.bks&DT=20070621205851&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Tue Apr 29, 2008 1:57 pm
Reply with quote

Hi !

Little example for that:

Panel is dispayed. validation of a Dataset is done in the rexx.
If DSN does not exist, err-msg is set and panel is displayed again.
Dataset ...ISPF.MESSAGES is used for defining user-massages.

J120830.ISPF.MESSAGES(UMMSG03) :

UMMSG035 .ALARM=NO
'Dataset does not exist'

J120830.ISPF.CLIST(TVADL) :

ADDRESS ISPEXEC "ADDPOP"

UMPAN = "TVADL002"
UMCUR = "UDS1"
UMMSG = " "
DSNRC = 9

DO WHILE DSNRC > 0
ADDRESS ISPEXEC "DISPLAY PANEL ("UMPAN")
MSG ("UMMSG")
CURSOR ("UMCUR") "
DISPRC = RC
IF DISPRC > 0 THEN EXIT DISPRC
ADDRESS ISPEXEC "VGET (UDS1) PROFILE "
ADDRESS ISPEXEC "DSINFO DATASET('"UDS1"') "
DSNRC = RC
IF DSNRC > 0 THEN UMMSG = 'UMMSG035'
END

J120830.ISPF.PANELS(TVADL002) :

+ Please provide Dataset-Name
+
+ ...Ds-Name: +\z
+
)INIT
.ZVARS = '(UDS1)'
VGET (UDS1) PROFILE
)PROC
VER(&UDS1,NB,MSG=UMMSG037)
VPUT (UDS1) PROFILE
)END


Hope it helps, regards, UmeySan
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Tue Apr 29, 2008 5:58 pm
Reply with quote

Hi,

Thank you so much for the reply.

I tried an example same like yours and created my own message and concatenated that message library with ISPMLIB

Code:

/*REXX*/                                   
UMPAN = "TY"                                     
UMCUR = "INP"                                     
UMMSG = " "                                       
ADDRESS ISPEXEC "DISPLAY PANEL ("UMPAN")         
MSG ("UMMSG")                                     
CURSOR ("UMCUR")"                                 
 ADDRESS ISPEXEC                                 
 SAY RC                                           
IF INP=100 THEN                                   
  UMMSG = 'MAL002'                               


Code:

)ATTR                             
   + TYPE(TEXT) INTENS(HIGH)       
   \ TYPE(INPUT) INTENS(LOW)       
)BODY EXPAND($$)                   
+   $-$                           
+                                 
+ INPUT: +\Z                       
+                                 
)INIT                             
.ZVARS = '(INP)'                   
)PROC                             
VER(&INP,NB,MSG=MAL002)           
)END                               


Also i gave my input as 100 but then am not getting the error message

Please let me know if am doing something wrong.
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Wed Apr 30, 2008 10:30 am
Reply with quote

Hi,

Thanks everyone for all your help

I tried again and got it corrected the mistake was in the REXX

i didnt have the DO WHILE condition telling the REXX when it should be executed under what condition thats it.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Apr 30, 2008 11:15 am
Reply with quote

Good to hear that it is now working.

Thank you for posting the resolution icon_smile.gif

d
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Apr 30, 2008 3:45 pm
Reply with quote

Hi & namastē malathy_tv !

Nice to hear, that it works.
Nice to see a "UMPAN" variable in a piece of code in chennai / india !

Poi varukiren & Regards,
UmeySan
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Wed Apr 30, 2008 5:09 pm
Reply with quote

Hi Gurus,

I have one more doubt

we are able to call the error message if we have check in the panels passing the message ID in it as follows

VER(&INP,NB,MSG=MAL001)

and then validitating and passing it again through REXX

but what if donot want to verify the input in the panels but validate and throw error message for the invalid input

how can this be achieved.

Thanks in advance
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Apr 30, 2008 5:39 pm
Reply with quote

HI malathy_tv !

You don't really need the "VER(&INP,NB,MSG=MAL002)" in the panel
)PROC section, if you will do all validations in Rexx.

In my little example, as you could see, i used two different messages.
In the Panel, the input was only checked to be not blank, MSG037.

Then in Rexx, the entered DSN was checked against existence.
Here MSG035 was used if DSN not exists.

So this dat beed two separate & different validations.

Poi varukiren & Regards,
UmeySan
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Fri May 02, 2008 10:00 am
Reply with quote

Hi Umeysen,

Nandri ( Thank you )

i got your point what you said ....

i have one more thing i want to create my own error message, is that enough if i create the msglib ( a PDS) and concatenate with the ISPMLIB using the "ALLOC FA(ISPMLIB) DA(PDS.MSGLIB)" or do i have to any thing more as when i try executing this it says

message not found in 'ISPMLIB' library.
Current dialog statement:
DISPLAY PANEL (BFSP) MSG (MAL004)



Part of my REXX is:

DO WHILE STA > 0
ADDRESS ISPEXEC "DISPLAY PANEL ("UMPAN")
MSG ("UMMSG")"
...
P1 = SUBSTR(POL,1,2)
A = VERIFY(P1,XRANGE('A','Z'))
IF (A = 0 & B = 0) THEN STA=0
ELSE UMMSG = 'MAL004'

any idea....
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri May 02, 2008 10:25 am
Reply with quote

Hi,
are you sure that the ALLOC command is working ?

Put trace on.


Gerry
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Fri May 02, 2008 10:33 am
Reply with quote

Hi,

I could see my MSGLIB getting concatenated with the ISPMLIB when i did the ALLOC i checked by doing ISRDDN

but still the error message says its not found... is there any other way that we can create our own messages.

Thanks.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri May 02, 2008 11:06 am
Reply with quote

Hi,
I'm assuming you were able to see the member via ISRDDN ie. MEM MAL004

What does member MAL004 look like ?


Gerry
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Fri May 02, 2008 11:37 am
Reply with quote

Hi,

Its not a Member in the PDS it is like a msg id inside some member, this member is present in the PDS PDS.MSGLIB

and i was able to see the PDS PDS.MSGLIB using ISRDDN

EX:

MAL002 'INVALID OPTION'

MAL004 'INVALID STATE NUMBER'
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Fri May 02, 2008 11:42 am
Reply with quote

Hi,

MAL004 is not a member it is like the MSGID, it is present inside one of the member of the PDS.MSGLIB library

i was able to see only that the PDS.MSGLIB getting concatenated with the ISPMLIB using ISRDDN

Example of the MSGID present inside the member:

MAL002 'INVALID OPTION'

MAL004 'INVALID STATE NUMBER'
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Fri May 02, 2008 5:17 pm
Reply with quote

Hi,

i found one method of populating the error message that is by using ZEDMSG

here am throwing the panels to get the input, validate in rexx and throw the error message

as UmeySan said i used this do while loop but when i do this am not able to check and validate both of my input on the same time

if either of these is correct it comes out without checking the other all this is because of using DO WHILE STA > 0 and setting the value to zero after every check but if i didnt do that am not getting the erro message as i said previously

/*REXX*/

STA = 9
DO WHILE STA > 0
ZEDSMSG = " "
ADDRESS ISPEXEC
"ADDPOP ROW(24) COLUMN(60)"
"DISPLAY PANEL ("PANEL")"
AGN_CHK:
A3 = VERIFY(AGN,XRANGE('0','9'))
IF A3 = 0 THEN STA=0
ELSE ZEDSMSG = 'INVALID AGENCY NUMBER'
"ISPEXEC SETMSG MSG(ISRZ001)"
RETURN
STE_CHK:
A4 = VERIFY(STE,XRANGE('A','Z'))
IF (A4 = 0 & LENGTH(STE) = 2 )THEN STA=0
ELSE ZEDSMSG = 'INVALID STATE CODE'
"ISPEXEC SETMSG MSG(ISRZ001)"
RETURN

so what can be done on this regards

Thanks in advance.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat May 10, 2008 4:37 am
Reply with quote

Regarding your program:
Code:

/*REXX*/                                   
STA = 9                                   
DO WHILE STA > 0                           
ZEDSMSG = " "                             
ADDRESS ISPEXEC                           
"ADDPOP ROW(24) COLUMN(60)"               
"DISPLAY PANEL ("PANEL")"                 
AGN_CHK:                                   
A3 = VERIFY(AGN,XRANGE('0','9'))           
IF A3 = 0 THEN STA=0                       
ELSE ZEDSMSG = 'INVALID AGENCY NUMBER'     
"ISPEXEC SETMSG MSG(ISRZ001)"             
RETURN                                     
STE_CHK:                                   
A4 = VERIFY(STE,XRANGE('A','Z'))           
IF (A4 = 0 & LENGTH(STE) = 2 )THEN STA=0   
ELSE ZEDSMSG = 'INVALID STATE CODE'       
"ISPEXEC SETMSG MSG(ISRZ001)"             
RETURN                                     



1. I think you need an END statement to match the DO WHILE
2. your panel name is a variable, but the name is not set anywhere
3. remove the RETURN statements. They will end the program, but I think you want to keep trying until no errors are found.
4. I do not think you should set STA=0 until both checks are ok. Currently, it will exit if one is ok, but not the other.
5. perhaps it got lost here in the forum, but you should indent nested lines
6. the ELSE will only perform one statement. you need to enclose your ZEDSMSG and the SETMSG within a DO / END clause.
7. move ADDPOP outside of loop.
8. good practice to have REMPOP after your ADDPOP
9. on your DO WHILE, good practice to enclose the condition within parenthesis.
10. check return code from DISPLAY. user might have cancelled panel, in which case you should exit and not perform any field checking.
11. surprised if "DISPLAY PANEL (" works. there should not be a space there.
12. I do not think you need the labels (AGN_CHK, STE_CHK)
13. I think your short messages should be in mixed case.
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 Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts IBM OnDemand Folders displaying to al... IBM Tools 6
No new posts Error while running web tool kit REXX... CLIST & REXX 5
Search our Forums:

Back to Top