IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Find Special char in Rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Jul 18, 2011 1:36 pm
Reply with quote

Hi,

Can anyone please tell me how we can check in rexx if a string is having only alphanumeric characters and underscores?

Example.
The following strings are valid
Code:
AAAA
1AAA_A
_AAAA
A12_1
AA1_


The following strings are NOT valid
Code:
AAAA
A@AA_A
_AA%AA
A12_1
A?A1_
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 18, 2011 1:43 pm
Reply with quote

First in each is AAAA, so is it valid or not? Also A12_1 appears in both.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jul 18, 2011 1:48 pm
Reply with quote

if it is under ISREDIT MACRO, then use find/search command

if it is a REXX SCRIPT being executed and not an ISREDIT MACRO
you could do the same thing I did and look for commands like POS.

but as Bill said,
your example sucks.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jul 18, 2011 2:06 pm
Reply with quote

read the manual and meditate on the VERIFY builtin
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Jul 18, 2011 2:28 pm
Reply with quote

I am sorry...

NOT VAILD are
Code:

A@AA_A
_AA%AA
A?A1_
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 18, 2011 2:36 pm
Reply with quote

If you search the forum, you'll even find a working example of VERIFY from very recently.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Jul 18, 2011 2:38 pm
Reply with quote

Thanks enrico... VERIFY worked for me....
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Jul 19, 2011 1:03 am
Reply with quote

Also try DATATYPE
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Jul 19, 2011 12:14 pm
Reply with quote

Hi Nic,

I tried datatype but was was stuck in how to check it any of the other characters are present apart from valid ones (0-9,A-Z,_).

DATATYPE provides only a few options

either BooleanNo = DATATYPE( String , Option )
or CHARorNUM = DATATYPE( String )
Options:
A - Alphanumeric (A-Z,a-z,0-9) N - Valid Number
B - Binary only (0,1) U - Uppercase only (A-Z)
L - Lower case only(a-z) W - Whole Number
M -Mixed case (A-Z, a-z) X - Hexadecimal (0-9, A-E)
S - Valid REXX Symbol(A-Z,a-z, 0-9 ! ? _ .)
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 19, 2011 12:27 pm
Reply with quote

You could change all occurences of the underscore to an alpha, then do the alphanumeric. As long as you don't use the changed data for anything but the test.

I think the verify provides a more easily understood solution.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Jul 19, 2011 12:39 pm
Reply with quote

Quote:
You could change all occurences of the underscore to an alpha

Sometime back we had a problem of getting alpha symbol "α" in a mainframe report, but was unable to do it, can't find the EBCDIC code for it :S . How to get this character "α" in mainframe screen?
Maybe a bit too off-topic..

Edited: Looks like the alpha symbol above, is getting translated. Alpha, the one on Start->All programs->Accessories->System Tools->Character Map->Search for->alpha
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top