|
This is one of the places where activation groups can help you. When a new activation group is created it's locale is set from QLOCALE which, hopefully, is EN_US which is what you need. If not, use setlocale() to make it so. Apparently using the setlocale() function before the regex functions resets the locale for everything in the activation group. So run your regex routines in their own named activation group and use setlocale to set the locale to EN_US before running regexcomp or regexec.
http://www-912.ibm.com/s_dir/SLKBase.nsf/1ac66549a21402188625680b0002037e/c1a90c4ee5dd1a6686257a3a00591304?OpenDocument
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark S Waterbury
Sent: Friday, March 22, 2013 10:53 AM
To: Midrange Systems Technical Discussion
Subject: Re: Locales and regular expressions
Hi, Tim:
What CCSID is the job running in?
Perhaps you could do something like this, in a CL "wrapper" ...
...
RTVJOBA CCSID(&CCSID)
CHGJOB JOB(*) CCSID(37) /* set to CCSID 37 temporarily */
CALL your-program-that-does-the-regex-stuff
CHGJOB JOB(*) CCSID(&CCSID) /* restore previous CCSID */
...
Perhaps you can run a quick experiment to see if that might help?
Mark S. Waterbury
> On 3/22/2013 10:24 AM, Tim Bronski wrote:
I've cross posted this to the C list but it doesn't get much traffic--
so this question might get more of an audience here. I've been having
issues with using regular expressions (as in a sscanf function) where
the locale might vary. I've looked all over the ibm site but there's
very little with any definition on exactly what effect locales have on
expression statements. How do I locale protect my expressions?
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.