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: 2177
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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm


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