Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
how to find whether the line has any numbers?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
seenivasakan
Currently Banned

New User


Joined: 13 May 2007
Posts: 21
Location: Karnataka

PostPosted: Thu Mar 27, 2008 2:39 pm    Post subject: how to find whether the line has any numbers?
Reply with quote

Greetings.

I have a small requirement to find whether any line has any numercial values. if anyone knows any function or any other method to find this, please share it with me

Regards
Back to top
View user's profile Send private message
References
PostPosted: Thu Mar 27, 2008 2:39 pm    Post subject: Re: how to find whether the line has any numbers? Reply with quote

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 1845
Location: italy

PostPosted: Thu Mar 27, 2008 2:54 pm    Post subject: Reply to: how to find whether the line has any numbers?
Reply with quote

verify(string,"0123456789","M")
Back to top
View user's profile Send private message
Marso

Active User


Joined: 13 Mar 2006
Posts: 264
Location: Israel

PostPosted: Thu Mar 27, 2008 4:17 pm    Post subject:
Reply with quote

or:
Code:
If DataType(myvar,'W') = 0 Then
   Say 'It''s a whole number!'
Else
   Say 'That''s not a number!'

Use 'N' instead of 'W' if you want to accept any number
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 252
Location: Spain

PostPosted: Thu Mar 27, 2008 5:06 pm    Post subject:
Reply with quote

if I'm not wrong the question is not if the string is numeric or not BUT if the string contains any numercial values... that's the difference between enrico and Marso answers...
Back to top
View user's profile Send private message
seenivasakan
Currently Banned

New User


Joined: 13 May 2007
Posts: 21
Location: Karnataka

PostPosted: Thu Mar 27, 2008 7:36 pm    Post subject: Reply to: how to find whether the line has any numbers?
Reply with quote

Actually my code is like below.
2 WST-EDIT-ADDL-BTCH-HEDR REDEFINES WST-BANK-TAPE-HEADER
2 WST-EDIT-ADDL-BTCH-HEDR GROUP 68 1 80 80
3 WST-EABH-ADDL-BTCH-RCRD-CD
XX 69 1 2 2

The first and third line does not have any numeric where as the second line has numbers. i want to find the first and third line?.

Any suggestions on any functions?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 1845
Location: italy

PostPosted: Thu Mar 27, 2008 7:53 pm    Post subject: Reply to: how to find whether the line has any numbers?
Reply with quote

You already got them
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 6031
Location: 221 B Baker St

PostPosted: Thu Mar 27, 2008 8:23 pm    Post subject:
Reply with quote

Hello,

Quote:
The first and third line does not have any numeric where as the second line has numbers. i want to find the first and third line?.
I see some number(s) in all 4 lines icon_confused.gif Why are the leading digits on the first 3 lines and the set of numbers in the 'xx' line not "numeric"?

What if a field was "WST-BANK-TAPE3-HEADER"? Is the 3 numeric?

Until you provide a more complete definition (if only for yourself), the implementation will be questionable at best.
Back to top
View user's profile Send private message
Marso

Active User


Joined: 13 Mar 2006
Posts: 264
Location: Israel

PostPosted: Thu Mar 27, 2008 10:15 pm    Post subject: Reply to: how to find whether the line has any numbers?
Reply with quote

dick scherrer wrote:
What if a field was "WST-BANK-TAPE3-HEADER"? Is the 3 numeric?

Exactly. If the meaningful numbers are always on the right side of the string, the logic will be completely different.
Why do we have always to beg for information? (just thinking aloud)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1