A macro can easily create the table you want. There are 2 assembler macro
commands you might not have considered to help you with this:
1. &(xxx&yyy) is a variable variable name. xxx is suffixed with the value in
variable yyy.
2. LOCTR groups storage together in the load module while the instructions are
grouped together in the program.

It sounds like your table is less than 2K. I personally wouldn't worry about
saving less than 1K unless it was in non-pageable storage.

Here is a sample of the code you were trying to create (may not actually work -
not tested but you get the idea how to code it):

         MACRO  ,
&l     JUNK   ,
&cnt  SETA 1
.LOOP ANOP ,
.* Since parms might have blanks, then always require it be quoted
&work  SETC '&syslist(&cnt)'(2,K'&syslist(&cnt))     strip quotes
.* var names don't allow blanks or special chars - convert to hex
.* using UPPER() to use first occurrance regardless of matching case
&var     SETC   C2X( UPPER('&work') )
           LCLC   &(junkvar_&var)
           AIF    ('&(junkvar_&var)' NE ' ').EXISTS
&(junkvar_&var) SETC   'JUNK&CNT'
JUNKVAR LOCTR ,
&(junkvar_&var) DC   CL30'&work'
&SYSECT LOCTR ,
.EXISTS ANOP ,
           DC     A(&(junkvar_&var))       Table entry pointer
&cnt   SETA &cnt+1
          AIF   (&cnt LE N'&syslist).LOOP
           MEXIT ,
           MEND ,

           JUNK  'John',
                     'JOHN',
                     'Jack',
                     'Jane'

If you didn't want to use multiple calls to the macro, then you would use GBLC,
use &SYSNDX when you SetC &(JUNKVAR_&VAR) to create a unique label and eliminate
the loop.

Jon Perryman.



________________________________
From: Rob van der Heij <[email protected]>

 I need to code a table of strings. Since there are quite a few
duplicates, it makes sense to add one level of indirection.

Reply via email to