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
 

 

Find Special char in Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Find Special char in Rexx
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Mon Jul 18, 2011 1:43 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Jul 18, 2011 2:06 pm    Post subject: Reply to: Find Special char in Rexx
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Mon Jul 18, 2011 2:36 pm    Post subject: Reply to: Find Special char in Rexx
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    Post subject:
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: 1717
Location: UK

PostPosted: Tue Jul 19, 2011 1:03 am    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Tue Jul 19, 2011 12:27 pm    Post subject: Reply to: Find Special char in Rexx
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: 1445
Location: Azeroth

PostPosted: Tue Jul 19, 2011 12:39 pm    Post subject:
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    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
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am


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