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 to validate a field in a map?

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

New User


Joined: 18 Mar 2009
Posts: 7
Location: trichy

PostPosted: Sat Mar 21, 2009 4:52 pm    Post subject: how to validate a field in a map?
Reply with quote

how to validate a field in a map?
suppose if the field in a map contains a phone number, how to check whether its number or not ?
i have given the code as

ELSE IF CPHNOL = 0 OR CPHNOI IS NOT NUMERIC THEN
MOVE 'CUSTOMER PHONE NUMBER IS INVALID' TO MSGO

but its not working
where CPHNOL is phone number field
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Sat Mar 21, 2009 5:12 pm    Post subject: Reply to: how to validate a field in a map?
Reply with quote

Quote:
but its not working


the symptom is a bit generic ... don' t You think so?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Mar 21, 2009 10:18 pm    Post subject:
Reply with quote

Hello,

The first order of business is to define the rules for what constitutes a valid phone number. Then you need to implement code that enforces all of the rules.

Quote:
but its not working
As mentioned - you provided nothing to help anyone help you. . . Posting "it didn't workig" simply wastes everyone's time.

Does the code complie correctly? Does the code abend? Does the code throw some programmed error (like the one you show in the bit of code)?

You need to post what the input contained and the result from that input.
Back to top
View user's profile Send private message
sindhu_raghu
Currently Banned

New User


Joined: 18 Mar 2009
Posts: 7
Location: trichy

PostPosted: Sat Mar 21, 2009 10:28 pm    Post subject: Reply to: how to validate a field in a map?
Reply with quote

yeah thats code is not abending and its not giving compiler error

but the validation is not done properly
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat Mar 21, 2009 10:31 pm    Post subject:
Reply with quote

What is the definition of CPHNOL and what does it contain?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Mar 21, 2009 10:42 pm    Post subject:
Reply with quote

Hello,

Quote:
but the validation is not done properly
You need to post the definition of "properly". If the rules are not known it just wastes time.

Show what values you use as input and what should happen for each input used. FWIW - the posted code does very little to validate a phone number. . .

Do not post "it is not working". . .
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: Sat Mar 21, 2009 11:18 pm    Post subject:
Reply with quote

Quote:
ELSE IF CPHNOL = 0 OR CPHNOI IS NOT NUMERIC THEN
MOVE 'CUSTOMER PHONE NUMBER IS INVALID' TO MSGO

but its not working
where CPHNOL is phone number field
Actually, I presume CPHNO is the map field -- CPHNOL would be the length attribute while CPHNOI would be the input map field. It appears you're checking to see if the field was not input (length of zero) or if the field is not numeric. That's not much of a validation routine, and you can't really tell which condition triggered the message. I suggest having one validation IF with message, then another validation IF with message so you can tell which condition is triggering a message. Something like:
Code:
ELSE IF CPHNOL = 0
          MOVE 'CUSTOMER PHONE NUMBER NOT INPUT' TO MSGO
     ELSE IF CPHNOI IS NOT NUMERIC THEN
          MOVE 'CUSTOMER PHONE NUMBER NOT NUMERIC' TO MSGO
Furthermore, most countries have pretty extended rules for what is a phone number that can be used for validation.
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 Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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