Regular expressions in macros (was: EXECIO ...)

24 views
Skip to first unread message

Paul Gilmartin

unread,
Nov 25, 2020, 11:26:37 AM11/25/20
to TSO REXX Discussion List, ISPF-List
(Cc: to ISPF-List)

On 2020-11-25, at 07:36:54, Seymour J Metz <sme...@GMU.EDU> wrote:
>
> If the macros are using ISPF services, then thet'd get the correct terminal translations. If you're concerned with file translations, that's a bit stickier.
>
Not as I read ISPF Edit and Edit Macros. It appears that
if the user is using a CP500 or CP037, that user needs two
sets of macros, one matching the terminal type and the other
CP1047 for batch use. Ouch!
(The last sentence about batch and 1047 may have been added
in response to my RCF.

ISPF Edit and Edit Macros SC19-3621-40
Regular expressions (string, string1)
...
ISPF queries the host code page defined for your TN3270 session. If the code page is one of the following:

00037 00871 01123 01156
00273 00875 01140 01157
00277 00924 01141 01158
00278 00930 01142 01160
00280 00933 01143 01165
00284 00935 01144 01364
00285 00937 01145 01371
00290 00939 01146 01388
00297 01025 01147 01390
00424 01026 01148 01399
00425 01027 01149 04971
00500 01047 01153 05123
00838 01112 01154 08482
00870 01122 01155 12712

ISPF uses the IBM C setlocale function with LC_ALL to set the corresponding C locale. This is done so that the special symbols (such as square brackets) within the regular expression are correctly interpreted when the regcomp function is used to compile the regular expression.

If the TN3270 code page is not one of the listed code pages then the default C locale is used when compiling the regular expression. If a regular expression is encountered on a FIND, CHANGE, or EXCLUDE
command that is specified in an Edit macro that is called from a batch Edit session (where no terminal is attached), code page 1047 is used.

-- gil

pAUL gILMARTIN (dARWIN)

unread,
Nov 25, 2020, 1:45:37 PM11/25/20
to TSO REXX Discussion List, ispf-...@nd.edu
On Wed, Nov 25, 2020 at 05:48:42PM +0000, Seymour J Metz wrote:
> The macro can test whether it's running in foreground or background.
>
So, then, do you envision querying the terminal CCSID and CALLing an
alternate version in case of mismatch?

Or embedding several versions of the payload and SELECTing the one
that conforms to the active terminal

Seriously!? Consider the maintenance burden and error exposure?

Perhaps PARSE SOURCE or SOURCELINE() to pipe itself through iconv(1),
read with ADDRESS popen; and INTERPRET. Need to replace NL with ";"
because INTERPRET doesn't recognize NL as a statement separator,
remembering to simply concatenate at unquoted "," ...

Seriously!?

I hate EBCDIC!

> ________________________________________
> From: Paul Gilmartin
> Sent: Wednesday, November 25, 2020 11:26 AM
>
> ISPF Edit and Edit Macros SC19-3621-40
> Regular expressions (string, string1)
> ...
> ISPF queries the host code page defined for your TN3270 session. If the code page is one of the following:
> ... [ 56 codee pages listed ] ...

Frank Clarke

unread,
Nov 25, 2020, 3:24:47 PM11/25/20
to TSO REXX Discussion List, 'Paul Gilmartin' via ISPF discussion list
This 'gil' post came straight through.  Most of the time, I only know Paul has posted because someone replies to it.


Paul Gilmartin

unread,
Nov 25, 2020, 5:02:42 PM11/25/20
to TSO REXX Discussion List, ISPF-List
On 2020-11-25, at 14:47:54, Seymour J Metz <sme...@GMU.EDU> wrote:
>
> "I ment what I said and I said what I meant,
> A sysprog is faithful, 100%"
> Horton hears an IPL by Dr. Seuss.
>
> Had I envisioned testing the CCSID then I would have so written. I envisaged testing foreground/background. Only this and noting more.
>
So no solace for foreground users with multiple terminal
types such as 037, 037(Bracket), 500, 1047, ...?

That's just cruel.

-- gil

Reply all
Reply to author
Forward
0 new messages