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

Validation on a numeric field


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

New User


Joined: 20 Jul 2006
Posts: 30

PostPosted: Sun Jan 03, 2010 11:57 am
Reply with quote

I have a numeric field 9(18) in CICS. I am performing a check on this field to make sure that only numeric value is entered. Now, when I enter only 12 in the field then the message which I have coded gets populated "FIELD SHOULD BE NUMERIC". But when I enter 12 prefixed by all zeroes (to fill all the 18 places) then it accepts the value. Is there any way around in CICS thru which I can avoid this?

Thanks in advance
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Jan 03, 2010 1:23 pm
Reply with quote

where do You have issues... in the logic or the coding ??

hint...
using reference modification scan the field until You find a non blank char
at that point check for numerics, when a new blank is found check that the rest is all blanks

in this way You will check for any alignment
data to the left ( You will skip the trailing blanks)
data to the right ( You will skip the leading blanks)
in anycase You will discard both the leading and trailing blanks
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Sun Jan 03, 2010 10:48 pm
Reply with quote

I think you can use JUSTIFY=(RIGHT,ZERO) for this field.
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts S0C7 - Field getting overlayed COBOL Programming 2
Search our Forums:

Back to Top