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
 
find whether numeric or alpha numeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rasitha chandran

New User


Joined: 25 Jan 2008
Posts: 6
Location: chennai

PostPosted: Thu Jan 31, 2008 3:49 pm    Post subject: find whether numeric or alpha numeric
Reply with quote

Hi,

I have a doubt.

For example,

01 a pic x(4).

and a=12,

now my query is if it is numeric it has to perform some action
and if is alphanumeric it has to do some other action. How can i find out that is numeric.
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Jan 31, 2008 4:17 pm    Post subject:
Reply with quote

rasitha,

Use CLASS condition.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 973
Location: Richmond, Virginia

PostPosted: Thu Jan 31, 2008 7:02 pm    Post subject:
Reply with quote

Your initial condition is ambiguous. For Pic X(4), A cannot = 12.

Which is your case?

A = '0012'
A = '12 '

or something else?
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 973
Location: Richmond, Virginia

PostPosted: Thu Jan 31, 2008 7:05 pm    Post subject:
Reply with quote

I should have shown my choices better to show the two blanks in the quotes:

Code:
A = '0012'
A = '12  '
Back to top
View user's profile Send private message
NOWAR

New User


Joined: 20 Feb 2007
Posts: 11
Location: Houthalen, Belgium

PostPosted: Thu Jan 31, 2008 7:21 pm    Post subject:
Reply with quote

Use the statement

Code:
IF A IS NUMERIC
THEN
  <action>
ELSE
  <action>
END-IF
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jan 31, 2008 10:50 pm    Post subject:
Reply with quote

Hello Rasitha and welcome to the forums,

Quote:
How can i find out that is numeric.
I believe your first task is to define just what is numeric. For example - is a leading blank still numeric?, trailing blank(s)? Should leading blanks be converted to zeros?

Once the rules are defined, implementation can proceed.
Back to top
View user's profile Send private message
raghumale

New User


Joined: 21 Feb 2008
Posts: 6
Location: banglore

PostPosted: Fri Feb 22, 2008 12:40 pm    Post subject:
Reply with quote

hi rasitha


ur question is confujion
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Fri Feb 22, 2008 12:47 pm    Post subject:
Reply with quote

HELLO Raghumale.....



Quote:
ur question is confujion



There is no confusion in this question answer has been given in the previous post. Please refer the previous posts.
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. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm

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