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

Validating two fields on Panel.


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

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Jun 29, 2011 6:24 pm
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: 1788
Location: Bloomington, IL

PostPosted: Wed Jun 29, 2011 7:03 pm
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: 1742
Location: Tirupur, India

PostPosted: Wed Jun 29, 2011 7:09 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts panel creation question TSO/ISPF 12
Search our Forums:

Back to Top