|
|
| Author |
Message |
malathy_tv
New User
Joined: 29 May 2007 Posts: 18 Location: chennai
|
|
|
|
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 |
|
 |
References
|
Posted: Mon Apr 28, 2008 11:41 am Post subject: Re: Displaying Error Messages in Panels |
 |
|
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 2291 Location: italy
|
|
|
|
| Code: |
zerrsm = "short message text"
zerrlm = "long message text"
Address ISPEXEC "SETMSG MSG(ISRZ002) " |
self explanatory isn' t it |
|
| Back to top |
|
 |
malathy_tv
New User
Joined: 29 May 2007 Posts: 18 Location: chennai
|
|
|
|
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 |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 2291 Location: italy
|
|
| Back to top |
|
 |
UmeySan
Senior Member
Joined: 22 Aug 2006 Posts: 579 Location: Germany
|
|
|
|
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 |
|
 |
malathy_tv
New User
Joined: 29 May 2007 Posts: 18 Location: chennai
|
|
|
|
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 |
|
 |
malathy_tv
New User
Joined: 29 May 2007 Posts: 18 Location: chennai
|
|
|
|
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 |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6725 Location: 221 B Baker St
|
|
|
|
Good to hear that it is now working.
Thank you for posting the resolution
d |
|
| Back to top |
|
 |
UmeySan
Senior Member
Joined: 22 Aug 2006 Posts: 579 Location: Germany
|
|
|
|
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 |
|
 |
malathy_tv
New User
Joined: 29 May 2007 Posts: 18 Location: chennai
|
|
|
|
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 |
|
 |
UmeySan
Senior Member
Joined: 22 Aug 2006 Posts: 579 Location: Germany
|
|
|
|
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 |
|
 |
malathy_tv
New User
Joined: 29 May 2007 Posts: 18 Location: chennai
|
|
|
|
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 |
|
 |
gcicchet
Active User
Joined: 28 Jul 2006 Posts: 295
|
|
|
|
Hi,
are you sure that the ALLOC command is working ?
Put trace on.
Gerry |
|
| Back to top |
|
 |
malathy_tv
New User
Joined: 29 May 2007 Posts: 18 Location: chennai
|
|
|
|
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 |
|
 |
gcicchet
Active User
Joined: 28 Jul 2006 Posts: 295
|
|
|
|
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 |
|
 |
|
|