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

can we check for is numeric for alphanumeric field.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Abi

New User


Joined: 27 Jul 2005
Posts: 35
Location: Chennai

PostPosted: Thu Nov 23, 2006 10:42 am
Reply with quote

I have a aplhanumeric field of length 20. Actaully it shld contain only numeric field...but in the database it has non numeric values...

So before processing i need to check for numeric values.If it contain any non-numeric values i need to replace it with numeric values.

WS_VARIABLE X(20)

Can i check for if ws-variable is numeric ?



2. Also in my previous topic i have asked how to convert non-numeric values to numeric and i got the answer of using UNSTRING

But if the filed has values like
222-222-222
22 2222-222

how can i use unstring ?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Nov 23, 2006 11:00 am
Reply with quote

Hi ABi,

Quote:
So before processing i need to check for numeric values.If it contain any non-numeric values i need to replace it with numeric values.

WS_VARIABLE X(20)

Can i check for if ws-variable is numeric ?


Ya u can check

Code:
IF WS_VARIABLE IS NUMERIC
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Nov 23, 2006 2:55 pm
Reply with quote

Hi Abi

I think you shoud go character by character and check if it is numeric and move only the numeric digits to an output field. If there is any other possibility please let me know.

Thanks
Arun
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 -> COBOL Programming

 


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 SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Join 2 files according to one key field. JCL & VSAM 3
Search our Forums:

Back to Top