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
 
REXX - Validating the digits of a variable

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

New User


Joined: 15 Nov 2005
Posts: 4

PostPosted: Tue Nov 15, 2005 3:35 pm    Post subject: REXX - Validating the digits of a variable
Reply with quote

Hi,

Is there any REXX command to do the following:

Assume X is 5 digits long, i need to validate whether all the 5 digits are populated or not.

I know, sometimes a single command will not be sufficient to do the above functionality,so, can you please let me know the command to retrieve individual digits of a variable.

Regards,
Sri
Back to top
View user's profile Send private message
References
PostPosted: Tue Nov 15, 2005 3:35 pm    Post subject: Re: REXX - Validating the digits of a variable Reply with quote

Paddy

Active User


Joined: 12 Sep 2005
Posts: 53
Location: Paris France

PostPosted: Tue Nov 15, 2005 6:34 pm    Post subject:
Reply with quote

Hi Sri,

You can try this function :

SUBSTR(X,n,length) with n = 1 for the first digit and length = 1 for one digit.



Regards
Paddy icon_biggrin.gif
Back to top
View user's profile Send private message
rexxhead

New User


Joined: 15 Nov 2005
Posts: 3
Location: Florida SunCoast

PostPosted: Tue Nov 15, 2005 6:39 pm    Post subject:
Reply with quote

Code:

if Verify(X,"0123456789") > 0 then ...

it's not all digits.
Back to top
View user's profile Send private message
sridevi_g

New User


Joined: 15 Nov 2005
Posts: 4

PostPosted: Wed Nov 16, 2005 3:12 pm    Post subject: REXX - Validating the digits of a variable
Reply with quote

Thanks Paddy. It works.
Back to top
View user's profile Send private message
mainframesguru

New User


Joined: 24 Jun 2005
Posts: 32
Location: Hyderabad

PostPosted: Thu Nov 17, 2005 10:56 am    Post subject: Re: REXX - Validating the digits of a variable
Reply with quote

HI all,


As its said that, X is a numeric item, then just use simple following logic:


If X > 10000 AND X < 99999 THEN
do
SOME LOGIC
end
ELSE
do
SOME OTHER LOGIC
end


Thanks,
Vamshi Krishna Indla
Back to top
View user's profile Send private message
sridevi_g

New User


Joined: 15 Nov 2005
Posts: 4

PostPosted: Thu Nov 17, 2005 2:48 pm    Post subject: REXX - Validating the digits of a variable
Reply with quote

Hi Paddy,

I think SUBSTR works only for character variables, what is the command for numeric variables.

Regards,
Sri
Back to top
View user's profile Send private message
Paddy

Active User


Joined: 12 Sep 2005
Posts: 53
Location: Paris France

PostPosted: Thu Nov 17, 2005 3:14 pm    Post subject: Re: REXX - Validating the digits of a variable
Reply with quote

Hi Sri,

SUBSTR function works equally with character or numeric variables.


Regards
Paddy :)
Back to top
View user's profile Send private message
mak_tcs

Active User


Joined: 23 Nov 2005
Posts: 76
Location: Minneapolis, MN USA

PostPosted: Wed Nov 23, 2005 8:01 pm    Post subject:
Reply with quote

Hi Sri,

I dont know whether my understanding of ur query is correct.
I assume X is a string not an array.
U can check the string by using the following function

xlen= LENGTH(X)

xlen will hold value 5 if the string X is populated with 5 digits.

Please let me know if can help u in better way

Thanks,
Mani
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