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
 
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: 10457
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: 8280
Location: Dubuque, Iowa, 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 How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts VALIDATE option in BIND jcl Poha Eater DB2 2 Mon Feb 26, 2018 7:08 pm
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm

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