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
 

 

How do i do the validation to reject the following

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
sprikitik

New User


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

PostPosted: Wed Apr 22, 2009 8:44 pm    Post subject: How do i do the validation to reject the following
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: 2150
Location: At my coffee table

PostPosted: Wed Apr 22, 2009 8:54 pm    Post subject:
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: 58
Location: Makati City, Philippines

PostPosted: Wed Apr 22, 2009 8:58 pm    Post subject: Reply to: Help me with ValidAtion
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: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Wed Apr 22, 2009 9:03 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Wed Apr 22, 2009 9:10 pm    Post subject: Re: Reply to: Help me with ValidAtion
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: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Wed Apr 22, 2009 9:21 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Rexx Panel Validation ajithajt CLIST & REXX 6 Sun Jul 17, 2016 10:50 pm
No new posts Validation for numeric fields, comp-3... kunal jain COBOL Programming 22 Sun Mar 29, 2015 4:14 am
No new posts IMS Pre-load Validation - Performance... yogi.47eie IMS DB/DC 4 Fri Oct 24, 2014 1:18 pm
No new posts Validation of reports generated in As... deb_parthas PL/I & Assembler 3 Wed Jul 30, 2014 3:18 pm
No new posts data validation from input file amarjit singh COBOL Programming 12 Fri Apr 26, 2013 5:30 pm


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