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
 
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: 1190
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: 2352
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
This topic is locked: you cannot edit posts or make replies. GDG gen check using REXX raghuraman123 CLIST & REXX 6 Wed Apr 18, 2018 9:18 pm
No new posts How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
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

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