Ed.
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
Kind regards,
-Steve Comstock
The Trainer's Friend, Inc.
303-393-8716
http://www.trainersfriend.com
� z/OS Application development made easier
��� * Our classes include
������ + How things work
������ + Programming examples with realistic applications
������ + Starter / skeleton code
������ + Complete working programs
������ + Useful utilities and subroutines
������ + Tips and techniques
==> call or email to receive a free sample student handout <==
DATATYPE(string) returns a value of NUM or CHAR. Note that a null string
returns CHAR.
Other formats: (all return 1 for true, and 0 for false)
DATATYPE(string,'N') - is a valid REXX number
DATATYPE(string,'W') - is a valid whole number
DATATYPE(string,'B') - is a binary number
DATATYPE(string,'X') - is a hex number
So you can code:
if datatype(num,'W') then say num 'is a whole number'
See TSO/E REXX Reference for more info.
Hayim
_____________________________________
Hayim Sokolsky, CISSP
Mainframe Security Architect
DTCC Corporate Information Security
18301 Bermuda Green Dr, MS 1-CIS
Tampa FL 33647-1760
Tel. (813) 470-2177
Ed Benoit <Ibm...@AOL.COM>
Sent by: TSO REXX Discussion List <TSO-...@VM.MARIST.EDU>
2009.12.07 18:33
Please respond to
TSO REXX Discussion List <TSO-...@VM.MARIST.EDU>
Subject
[TSO-REXX] REXX Question about Numbers
Ed.
<BR>_____________________________________________________________
<FONT size=2><BR>
DTCC DISCLAIMER: This email and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom they are addressed. If you have received this email
in error, please notify us immediately and delete the email and any
attachments from your system. The recipient should check this email
and any attachments for the presence of viruses. The company
accepts no liability for any damage caused by any virus transmitted
by this email.</FONT>
Mickey
--------------------------------------------------
From: "Ed Benoit" <Ibm...@AOL.COM>
Sent: Monday, December 07, 2009 3:33 PM
To: <TSO-...@VM.MARIST.EDU>
Subject: [TSO-REXX] REXX Question about Numbers
> Hello List,
>How can I determine if a variable is a number or not? Is
>there a key word?
As others have said, you can use DATATYPE. Be aware of
surprising results. For instance, 1e6 will show as
datatype=num (it equals one million).
If you want to verify that a variable contains only digits
(and, maybe, signs or decimal points), you could use
DATATYPE followed by a VERIFY.
--
I cannot receive mail at the address this was sent from.
To reply directly, send to ar23hur "at" intergate "dot" com
Lizette
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of
Ed Benoit
Sent: Monday, December 07, 2009 6:34 PM
To: TSO-...@VM.MARIST.EDU
Subject: [TSO-REXX] REXX Question about Numbers