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
 

 

can we check for is numeric for alphanumeric field.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: can we check for is numeric for alphanumeric field.
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: 1187
Location: Bangalore,India

PostPosted: Thu Nov 23, 2006 11:00 am    Post subject:
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: 2276
Location: @my desk

PostPosted: Thu Nov 23, 2006 2:55 pm    Post subject: Re: can we check for is numeric for alphanumeric field.
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am


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