Brad Gronli Posted April 16 Share Posted April 16 I have a program that I am attempting use this function in, however, when the program is run, REGEX is ignored -SET ®2 = CHAR(95)||CHAR(173)||'~`!#$%¬^&*()+={}¢Ý¦¨|\:;"<>?/'||CHAR(189); -* inside a DEFINE FILE EMAILV/A70V = TRIMV('T', EMAIL_ADDR, 70, ' ', 1, EMAILV); EMAILL/A1 = SUBSTR(ARGLEN(70, EMAILV, 'I4'), EMAILV, ARGLEN(70, EMAILV, 'I4'), ARGLEN(70, EMAILV, 'I4'), 1,'A1'); v_EMAIL/A1 = IF EMAIL_ADDR EQ '' THEN '2' ELSE IF REGEX(EMAIL_ADDR, '®2') OR EMAILL EQ '.' THEN '1' ELSE '0'; o_EMAIL_ADDR/A7 = IF v_EMAIL EQ '2' THEN 'MISSING' ELSE IF v_EMAIL EQ '1' THEN 'INVALID' ELSE ''; o_EMAIL_ADDR returns as ' ' when it should as INVALID, in my testing. Any ideas? Thanks Link to comment Share on other sites More sharing options...
Martin Yergeau Posted April 16 Share Posted April 16 With the following it seems to work as expected (As far as I understand what you are looking to do) -SET ®2 = '[~`!#$%¬^&*()+={}¢Ý¦¨|\:;"<>?/]'; Link to comment Share on other sites More sharing options...
Brad Gronli Posted April 17 Author Share Posted April 17 I work on a z/OS system and needed to use the CHAR function to return the correct meta characters. I did attempt with the coding Martin suggested but that does not work on our Mainframe. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now