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

How do i do the validation to reject the following


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 61
Location: Makati City, Philippines

PostPosted: Wed Apr 22, 2009 8:44 pm
Reply with quote

My screen has a single editable field which is 3 characters length. The valid values that can be entered is +1 to +99 or -1 to -99.

Possible valid combi are:

+1_
_+1
+99
-1_
_-8

and so on, as long as the numeric part is 1 to 99 and the sign is at the left, if no sign was provided, the default sign will be + (positive). So if i entered 1, the screen will be updated and will display +1_..

How do i do the validation such a way that the following values will be rejected?

1+_
99+
_1+
99-
and so on...

The idea is that the sign should always be at the left side of number and if no sign is provided, the sign will default to +


Thank you!
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 22, 2009 8:54 pm
Reply with quote

Have you looked at NUMVAL?
Back to top
View user's profile Send private message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 61
Location: Makati City, Philippines

PostPosted: Wed Apr 22, 2009 8:58 pm
Reply with quote

Yes i did, but the pgm is abending when the value is invalid. For example 99+

Thanks!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 22, 2009 9:03 pm
Reply with quote

If you truly insist on rejecting the invalid values, you'll need to write your own routine to validate the field -- check right to left for a plus or minus before a digit, for example.

BIF DEEDIT converts 99+ into 099 but it doesn't give you any option to recognize the invalid format -- you just get the numeric data value back.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 22, 2009 9:10 pm
Reply with quote

sprikitik wrote:
Yes i did, but the pgm is abending when the value is invalid. For example 99+

99+ seems to match:
Code:

    ___ Format 2: argument-1, monetary format ________________________________________________________
   |                                                                                                  |
   | >>__ _______ __ _digit__ ______________ _ __ _______ __ ____ __ _______ ______________________>< |
   |     |_space_|  |        |_.__ _______ _| |  |_space_|  |_ +_|  |_space_|                         |
   |                |             |_digit_|   |             |_ -_|                                    |
   |                |_.__digit________________|             |_CR_|                                    |
   |                                                        |_DB_|                                    |
   |                                                                                                  |
   |__________________________________________________________________________________________________|
What does your NUMVAL look like?
What do the data areas look like?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 22, 2009 9:21 pm
Reply with quote

Interesting ... I used this code:
Code:
           05  NUMVAL-CHAR             PIC X(03) VALUE '99+'.
           05  NUMVAL-NUMBER           PIC S9(03) SIGN LEADING SEPARATE.
      /
       PROCEDURE DIVISION.
       S1000-MAIN       SECTION.
           COMPUTE NUMVAL-NUMBER = FUNCTION NUMVAL (NUMVAL-CHAR) .
           DISPLAY 'NUMVAL-CHAR   ' NUMVAL-CHAR.
           DISPLAY 'NUMVAL-NUMBER ' NUMVAL-NUMBER.
and got these results:
Code:
 NUMVAL-CHAR   99+
 NUMVAL-NUMBER +099
so I'm not sure why your program would ABEND on known good data.
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Related to performing validation of f... DFSORT/ICETOOL 19
No new posts Feild level validation to test first ... JCL & VSAM 10
No new posts Rexx Panel Validation CLIST & REXX 6
No new posts Validation for numeric fields, comp-3... COBOL Programming 22
No new posts IMS Pre-load Validation - Performance... IMS DB/DC 4
Search our Forums:

Back to Top