MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Capturing an invalid range of data in panels

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
sat
Beginner


Joined: 23 Jan 2006
Posts: 8
Topics: 3

PostPosted: Thu Feb 16, 2006 11:37 am    Post subject: Capturing an invalid range of data in panels Reply with quote

Hi,

I have a clist panel variable, &memberno. The field is 5 character length. Any 5 length character value is acceptable in this field except the following range: A0001 thru A9999.
That is, any values between A0001 and A9999 is invalid and I want to throw a message. For example: if user inputs A12345, then the input is invalid. But if user inputs, AA001, then the input is valid and want to continue processing. The invalid range is just A0001 thru A9999. How can I capture this in my clist panel.

Thanks
Back to top
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Thu Feb 16, 2006 12:49 pm    Post subject: Reply with quote

You can use the panel statement VER, with the PICT keyword. The VER statement is documented in the fine manual.

Another option is to use a panel exit.

O.
________
Ferrari 333 SP


Last edited by ofer71 on Sat Feb 05, 2011 11:33 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Thu Feb 16, 2006 5:02 pm    Post subject: Reply with quote

Try this:

Code:

 /* Value must be 5 characters consisted of A-Z and 0-9 (MSGX010)  */
 /* not between A0001 and A9999 (MSGX011)                          */
 IF (VER(&MEMBERNO,LEN,NE,5))
   .MSG = MSGX010
 ELSE IF (VER(&MEMBERNO,INCLUDE,ALPHAB,NUM))
            IF (&MEMBERNO >= A0001 AND &MEMBERNO <= A9999)
              .MSG = MSGX011
         ELSE .MSG = MSGX010

Back to top
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Fri Feb 17, 2006 1:34 am    Post subject: Reply with quote

One thing to remember about panel logic: The IF statement is indentation sensitive; That is - Your ELSE must be in the same column of the related IF.

O.
________
Honda Pacific Coast specifications


Last edited by ofer71 on Sat Feb 05, 2011 11:33 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Fri Feb 17, 2006 4:17 am    Post subject: Reply with quote

Danm, how does your code handle something like "A1BBB"?
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Fri Feb 17, 2006 10:08 am    Post subject: Reply with quote

Mervyn,

It displays MSGX011 (Invalid Range) since A1BBB is between 'A0001' and 'A9999'.
Code:

  IF (&MEMBERNO >= A0001 AND &MEMBERNO <= A9999)
     .MSG = MSGX011
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Fri Feb 17, 2006 10:38 am    Post subject: Reply with quote

Yes, but it does look as though sat expects the invalid values to be numeric after the initial "A".
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Fri Feb 17, 2006 11:56 am    Post subject: Reply with quote

Mervyn,

Not sure exactly what you mean. It says:
Quote:

Any 5 length character value is acceptable in this field except the following range: A0001 thru A9999.


What message do you want to see for "A1BBB"?
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Fri Feb 17, 2006 4:10 pm    Post subject: Reply with quote

Well, we won't know unless sat puts us right, but it does look as though the invalid values would be numeric in bytes 2-5, so "A1BBB" would be valid. I agree totally that "A1BBB" is actually in the range "A0001" to "A9999".
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Feb 17, 2006 11:58 pm    Post subject: Reply with quote

Quote:
if user inputs A12345, then the input is invalid. But if user inputs, AA001, then the input is valid and want to continue processing. The invalid range is just A0001 thru A9999.

The statement implies A9999 (1st char =a and 9999 numerics) is not allowed:
Code:
)BODY
+
% Something_VAL  +
+
+ P:'&P'
+
)PROC
 &P = TRUNC (&VAL,1)             
 IF (&P = 'A'and VER(&VAL,NB,PICT,A9999)) .MSG = XXX001
)END

or more crypticly:
Code:
)BODY                                                       
+                                                           
% Something_VAL  +                                           
+                                                           
)PROC                                                       
 IF (VER(&VAL,PICTCN,'/', 'A////','A9999')) .MSG = XXX001
)END
Back to top
View user's profile Send private message Visit poster's website
sat
Beginner


Joined: 23 Jan 2006
Posts: 8
Topics: 3

PostPosted: Mon Feb 20, 2006 2:54 pm    Post subject: Reply with quote

Sorry, I forgot this over the weekend while I was enjoying my flight to Florida. Man, Florida is quite nice Smile

Okay, your posts have really helped me...there are some changes to the requirement, but it is not finalized...I am working through it.

Now for 'A1BBB', it is a valid input and it should not throw the message. Only the values from A0001 thru A9999 is invalid.

Thanks,
sat!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group