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: 1491
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: 1755
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: 1491
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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts Need help in reading and validating a... ABINAYATHULASI COBOL Programming 8 Tue Apr 18, 2017 11:42 am
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm


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