Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Validating two fields on Panel.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1474
Location: Chennai

PostPosted: Wed Jun 29, 2011 6:24 pm    Post subject: Validating two fields on Panel.
Reply with quote

Hello,
I am trying to build a ISPF panel but unable to figure out how to add validation to a field.
Code:

+   INSTREAM   : $I+     <-- ENTER "Y" TO SELECT
+   ATTACHMENT : $A+     <-- ENTER "Y" TO SELECT
+   FILE EXTENSION (Eg TXT OR XLS OR RTF) :$EXT+
)INIT                                           
  .HELP = TUTORPAN                               
  .CURSOR = EID                                 
)PROC                                           
  VER (&I,LIST,Y,MSG=MESG001)                   
  VER (&A,LIST,Y,MSG=MESG001)                   
  IF (&I = 'Y' AND &A = 'Y') THEN
  .MSG = MESG002                 
  RETURN                                                         
)END   


In the above panel, the validations required are,
1) The valid value for &I or &A is Y.( The VER statement took care of this part)
2) Both &I and &A cannot contain Y at the same time(mutually exclusive)

I am unable to do the second validation mentioned above.

When this panel was executed, the MESG002 was getting displayed when no values are entered,
if &I was entered as Y and &A was blank, still the MESG002 gets displayed.

Could you please help me on this.
Thanks for viewing.
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1753
Location: Bloomington, IL

PostPosted: Wed Jun 29, 2011 7:03 pm    Post subject:
Reply with quote

There is no THEN keyword in the panel language. Grouping into blocks is done by means of indentation, so you should code:
Code:
IF (&I = 'Y' AND &A = 'Y') THEN
   .MSG = MESG002
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1474
Location: Chennai

PostPosted: Wed Jun 29, 2011 7:09 pm    Post subject:
Reply with quote

Quote:
Grouping into blocks is done by means of indentation.

Many thanks for the information & correcting the code.
It works fine now. icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts ISPF - How to come out of ISPF Panel parasmalik20 TSO/ISPF 5 Tue Feb 21, 2017 7:44 pm
No new posts the use of 'B3'x character in a panel Pedro TSO/ISPF 1 Thu Feb 16, 2017 3:09 am
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts Design of ISPF panel prino TSO/ISPF 2 Wed Jan 25, 2017 10:31 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us