Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1532
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: 1783
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: 1532
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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us