1

I am creating several similar (but not the same) invocations of the list form of the WTO macro in the global scope of my program:

__asm(                               
  "xxxUtilsStaticWtp WTO TEXT=*,ROUTCDE=(11),LINKAGE=,MF=L \n" // Static list form WTO
  : "DS"(xxxUtilsStaticWtp)                  // DS name to locate list form of WTO
  );                                                                                             ...
__asm(                                                                                            
      "xxxUtilsStaticSWto WTO TEXT=*,ROUTCDE=(2,10),DESC=(3),LINKAGE=,MF=L \n" // Static list form WTO
  : "DS"(xxxUtilsStaticSWto)                 // DS name to locate list form of WTO
  );

(Yes, I know that one has the label inside the assembler statement declaration and one does not, it does not appear to matter either way).

When this gets compiled, the compiler emits this information about these variables:

xxxUtilsStaticSWto                  Class = static, Length = 256
                                    Type = struct __ASM_DS_256
                                    3180-10:741, 3211-10:770

xxxUtilsStaticWtp                   Class = static, Length = 256
                                    Type = struct __ASM_DS_256
                                    3089-10:650, 3136-10:695
                                                                                         

Plus this error message:

ERROR CCN3244 XXXXX.XXXXX.H(XXXUTILS):741   External variable XXXUTILS cannot be redefined.

(Note that it works fine if one of the declarations is removed).

If I understand this correctly, the compiler is shortening the name down to eight characters (I am not using GOFF) so both of these are colliding with name XXXUTILS.

I know that I can keep other kinds of declarations at the global scope from being EXTERNAL by adding "static" to the declaration, e.g.

static int MyRoutine(int Input) { <code> }
or
static int AnInt = 5;

I spent some quality time with Inline assembly statements (IBM extension), but could not divine how to somehow squeeze the word "static" into the __asm statement or if there was another way to do it.

Anybody have any ideas on how to accomplish this?

Thank you, Scott Fagen

1 Answers1

1

Ok, further investigation/playing around has lead me to believe that this might be a compiler bug.  If I rename one of the DS variables from xxxUtils... to xxyUtils... everything compiles correctly.  Removing the "first eight character collision" eliminates the problem (which is how I will solve it for now).  

There is nothing in the assembler listing that even references xxxUtils or xxyUtils, which leads me to believe that the symbols are being somehow incorrectly tagged while the compiler is building up the information to create the $STATIC area of the module:

001CA8                             2713 $STATIC  DS    0D                                                        000000
.....
                      01D70        2751 @@LAB@5  EQU   *                                                         000000
                                   2752          WTO   TEXT=*,ROUTCDE=(11),LINKAGE=,MF=L                         000000
001D70                             2754+         DS    0F                                                       01-WTO 
001D70 0008                        2755+         DC    AL2(8)                   TEXT LENGTH            @YA17152 01-WTO 
001D72 8010                        2756+         DC    B'1000000000010000'      MCSFLAGS                        01-WTO 
001D74 00000000                    2757+         DC    AL4(0)                   MESSAGE TEXT ADDRESS       @L5A 01-WTO 
001D78 02                          2758+         DC    AL1(2)                   VERSION LEVEL              @PJC 01-WTO 
001D79 00                          2759+         DC    B'00000000'              MISCELLANEOUS FLAGS        @L2A 01-WTO 
001D7A 00                          2760+         DC    AL1(0)                   REPLY LENGTH               @L2A 01-WTO 
001D7B 68                          2761+         DC    AL1(104)                 LENGTH OF WPX              @L5C 01-WTO 
001D7C 0080                        2762+         DC    B'0000000010000000'      EXTENDED MCS FLAGS         @L2A 01-WTO 
001D7E 0000                        2763+         DC    AL2(0)                   RESERVED                   @L2A 01-WTO 
001D80 00000000                    2764+         DC    AL4(0)                   REPLY BUFFER ADDRESS       @P7C 01-WTO 
001D84 00000000                    2765+         DC    AL4(0)                   REPLY ECB ADDRESS          @P7C 01-WTO 
001D88 00000000                    2766+         DC    AL4(0)                   CONNECT ID                 @01C 01-WTO 
001D8C 0000                        2767+         DC    B'0000000000000000'      DESCRIPTOR CODES           @L2A 01-WTO 
001D8E 0000                        2768+         DC    AL2(0)                   RESERVED                   @L2A 01-WTO 
001D90 0020000000000000            2769+         DC    XL16'00200000000000000000000000000000'                  X01-WTO 
001D98 0000000000000000                +                                        EXTENDED ROUTING CODES     @L2A        
001DA0 0000                        2770+         DC    B'0000000000000000'      MESSAGE TYPE               @L2A 01-WTO 
001DA2 0000                        2771+         DC    AL2(0)                   MESSAGE'S PRIORITY         @L2A 01-WTO 
001DA4 4040404040404040            2772+         DC    CL8'        '            JOB ID                     @L2A 01-WTO 
001DAC 4040404040404040            2773+         DC    CL8'        '            JOB NAME                   @L2A 01-WTO 
001DB4 4040404040404040            2774+         DC    CL8'        '            RETRIEVAL KEY              @L2A 01-WTO 
001DBC 00000000                    2775+         DC    AL4(0)                   TOKEN FOR DOM              @P1C 01-WTO 
001DC0 00000000                    2776+         DC    AL4(0)                   CONSOLE ID                 @P1C 01-WTO 
001DC4 4040404040404040            2777+         DC    CL8'        '            SYSTEM NAME                @L2A 01-WTO 
001DCC 4040404040404040            2778+         DC    CL8'        '            CONSOLE NAME               @L3A 01-WTO 
001DD4 00000000                    2779+         DC    AL4(0)                   REPLY CONSOLE NAME/ID ADDR @L3A 01-WTO 
001DD8 00000000                    2780+         DC    AL4(0)                   CART ADDRESS               @L4C 01-WTO 
001DDC 00000000                    2781+         DC    AL4(0)                   WSPARM ADDRESS             @L6C 01-WTO 
                      00070        2782 @@LAB@5L EQU   *-@@LAB@5                                                 000000
                                   2783 &DSMAC   SETC  '@@LAB@5'                                                 000000
                                   2784 &DSSIZE  SETA  256                                                       000000
                                   2785 &MSIZE   SETA  @@LAB@5L                                                  000000
                                   2786          AIF   (&DSSIZE GE &MSIZE).@@OK@5                                000000
                                   2787 .@@OK@5  ANOP                                                            000000
001DE0                01DE0 01E70  2788          ORG   $STATIC+456                                               000000
                      01E70        2789 @@LAB@6  EQU   *                                                         000000
                                   2790          WTO   TEXT=*,ROUTCDE=(2,10),DESC=(3),LINKAGE=,MF=L              000000
001E70                             2792+         DS    0F                                                       01-WTO 
001E70 0008                        2793+         DC    AL2(8)                   TEXT LENGTH            @YA17152 01-WTO 
001E72 8010                        2794+         DC    B'1000000000010000'      MCSFLAGS                        01-WTO 
001E74 00000000                    2795+         DC    AL4(0)                   MESSAGE TEXT ADDRESS       @L5A 01-WTO 
001E78 02                          2796+         DC    AL1(2)                   VERSION LEVEL              @PJC 01-WTO 
001E79 00                          2797+         DC    B'00000000'              MISCELLANEOUS FLAGS        @L2A 01-WTO 
001E7A 00                          2798+         DC    AL1(0)                   REPLY LENGTH               @L2A 01-WTO 
001E7B 68                          2799+         DC    AL1(104)                 LENGTH OF WPX              @L5C 01-WTO 
001E7C 0080                        2800+         DC    B'0000000010000000'      EXTENDED MCS FLAGS         @L2A 01-WTO 
001E7E 0000                        2801+         DC    AL2(0)                   RESERVED                   @L2A 01-WTO 
001E80 00000000                    2802+         DC    AL4(0)                   REPLY BUFFER ADDRESS       @P7C 01-WTO 
001E84 00000000                    2803+         DC    AL4(0)                   REPLY ECB ADDRESS          @P7C 01-WTO 
001E88 00000000                    2804+         DC    AL4(0)                   CONNECT ID                 @01C 01-WTO 
001E8C 2000                        2805+         DC    B'0010000000000000'      DESCRIPTOR CODES           @L2A 01-WTO 
001E8E 0000                        2806+         DC    AL2(0)                   RESERVED                   @L2A 01-WTO 
001E90 4040000000000000            2807+         DC    XL16'40400000000000000000000000000000'                  X01-WTO 
001E98 0000000000000000                +                                        EXTENDED ROUTING CODES     @L2A        
001EA0 0000                        2808+         DC    B'0000000000000000'      MESSAGE TYPE               @L2A 01-WTO 
001EA2 0000                        2809+         DC    AL2(0)                   MESSAGE'S PRIORITY         @L2A 01-WTO 
001EA4 4040404040404040            2810+         DC    CL8'        '            JOB ID                     @L2A 01-WTO 
001EAC 4040404040404040            2811+         DC    CL8'        '            JOB NAME                   @L2A 01-WTO 
001EB4 4040404040404040            2812+         DC    CL8'        '            RETRIEVAL KEY              @L2A 01-WTO 
001EBC 00000000                    2813+         DC    AL4(0)                   TOKEN FOR DOM              @P1C 01-WTO 
001EC0 00000000                    2814+         DC    AL4(0)                   CONSOLE ID                 @P1C 01-WTO 
001EC4 4040404040404040            2815+         DC    CL8'        '            SYSTEM NAME                @L2A 01-WTO 
001ECC 4040404040404040            2816+         DC    CL8'        '            CONSOLE NAME               @L3A 01-WTO 
001ED4 00000000                    2817+         DC    AL4(0)                   REPLY CONSOLE NAME/ID ADDR @L3A 01-WTO 
001ED8 00000000                    2818+         DC    AL4(0)                   CART ADDRESS               @L4C 01-WTO 
001EDC 00000000                    2819+         DC    AL4(0)                   WSPARM ADDRESS             @L6C 01-WTO 
                      00070        2820 @@LAB@6L EQU   *-@@LAB@6                                                 000000
----- rest of $STATIC -----

The xxxUtils list form WTO is at x'1D70' and the xxyUtils list form is at x'1E70'.

A search of the assembler listing for xxxUtils or xxyUtils yields nothing.

I'd expect that this is a bug of some sort...

Thanks, Scott