Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
View previous topic :: :: View next topic  
Author Message
sridevi_g

New User


Joined: 15 Nov 2005
Posts: 3

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

Paddy

New User


Joined: 12 Sep 2005
Posts: 46
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: 3

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: 36
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: 3

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

New User


Joined: 12 Sep 2005
Posts: 46
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

New User


Joined: 23 Nov 2005
Posts: 69
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
Arun Kumar S

New User


Joined: 23 Jan 2009
Posts: 14
Location: Bangalore

PostPosted: Fri Jan 23, 2009 4:59 pm    Post subject:
Reply with quote

Hi Sri,

Yes the below statement will hold the length of the var.

Xlen= LENGTH(X) icon_cool.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10255
Location: italy

PostPosted: Fri Jan 23, 2009 5:09 pm    Post subject: Reply to: REXX - Validating the digits of a variable
Reply with quote

Arun,
you replied to a post more than three years old,
maybe Sri has solved his problem already,
he would be in big trouble if he hadn' t by now icon_biggrin.gif
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 -> CLIST & REXX 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. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us