More than 20 years ago I wrote an edit macro "EDOEND", that lets me exclude, in PL/I source, all statements other than

'PACKAGE',
'PROC',
'PROCEDURE',
'DO',
'BEGIN',
'SELECT', and
'END'

and a few days ago, using it again, I realised that it could benefit from adding a bit of Doug Nadel magic to it, as the '_' character is not part of the word character set, and as such the macro will happily un-exclude identifiers like "list_end" etc.

However, before his MVS goodies page was removed, Doug had put a little routine on it to include characters into the word character set:

=== CUT ===
/* Rexx ispf edit macro to add characters to the meaning of word    */
/*                                                                  */
/* This changes internal tables to force specific characters to be  */
/* considered part of a word.  For example, In COBOL, The dash is   */
/* valid in a name.  If you have code                               */
/*     MOVE ABC-DEF TO ABC.                                         */
/* and you issue                                                    */
/*     CHANGE ABC XYZ WORD                                          */
/* the result is                                                    */
/*     MOVE XYZ-DEF XYZ.                                            */
/* By using this command to allow dash to be part of a word, you'd  */
/* Get this result instead:                                         */
/*     MOVE ABC-DEF XYZ.                                            */
/* Add the characters you want to be part of a word below.  This    */
/* macro only needs to be run once per ISPF session but works fine  */
/* as an initial macro or session macro (see manual for ZUSERMAC)   */
/*------------------------------------------------------------------*/
wordchars = "-_"
/*------------------------------------------------------------------*/

"isredit macro"

tldp   = ptr(ptr(24 + ptr(112 + ptr(132 + ptr(540)))))
tablep = ptr(24 + ptr(20 + ptr(96 + ptr(56 + tldp))))

do while wordchars <> ""
  parse var wordchars char 2 wordchars
  call storage d2x(tablep + c2d(char)),1,"00"x
end
return

ptr: return c2d(bitand(storage(d2x(arg(1)), 4), "7fffffff"x))
=== CUT ===

and just using the "STORAGE" function on all 256 characters shows that you can reset the inclusion by setting the storage location (back) to "ff"x, and that's how I've modified "EDOEND", at the start it includes "_" as a word-character, at the end it excludes it again.

Use Doug's code to your advantage,

Robert
--
Robert AH Prins
robert.ah.prins(a)gmail.com
The hitchhiking grandfather - https://prino.neocities.org/indez.html
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to