Conditional assembly variable scope

3 views
Skip to first unread message

Joseph Reichman

unread,
Jun 27, 2023, 11:30:40 AM6/27/23
to ASSEMBL...@listserv.uga.edu
Would any know the difference in scope
Of a local used in open code and a global used
In a macro the both seem to have a scope of the entire assembly

Seymour J Metz

unread,
Jun 27, 2023, 12:09:00 PM6/27/23
to ASSEMBL...@listserv.uga.edu
The scope of the global &FOO is those units containing GBLx &FOO, where a unit is either a macro or the open code.

________________________________________
From: IBM Mainframe Assembler List <ASSEMBL...@LISTSERV.UGA.EDU> on behalf of Joseph Reichman <reich...@GMAIL.COM>
Sent: Tuesday, June 27, 2023 11:30 AM
To: ASSEMBL...@LISTSERV.UGA.EDU
Subject: Conditional assembly variable scope

Joseph Reichman

unread,
Jun 27, 2023, 12:45:05 PM6/27/23
to ASSEMBL...@listserv.uga.edu
Sorry but I don’t follow
If LCLx &FOO is declared in open code
And also let’s say assigned a value the scope is the entire assembly

If GBLx &FOO is declared inside a macro
And also say set

It’s scope is too the entire assembly ?


> On Jun 27, 2023, at 12:09 PM, Seymour J Metz <sme...@gmu.edu> wrote:
>
> The scope of the global &FOO is those units containing GBLx &FOO, where a unit is either a macro or the open code.

Jonathan Scott

unread,
Jun 27, 2023, 1:09:15 PM6/27/23
to ASSEMBL...@listserv.uga.edu
> Would any know the difference in scope
> Of a local used in open code and a global used
> In a macro the both seem to have a scope of the entire assembly

A local variable is unique to the context where it is defined,
so a local variable defined in open code applies to all open
code, and a local variable in a macro is defined only in that
macro. If the same name is used for a local variable in a
different context, it refers to a separate variable.

A global variable is the same variable in all contexts where it
is defined.

Jonathan Scott, HLASM
IBM Hursley, UK

Joseph Reichman

unread,
Jun 27, 2023, 1:19:27 PM6/27/23
to ASSEMBL...@listserv.uga.edu
Got it thanks



> On Jun 27, 2023, at 1:09 PM, Jonathan Scott <jonatha...@vnet.ibm.com> wrote:
>
> 

Seymour J Metz

unread,
Jun 27, 2023, 1:29:00 PM6/27/23
to ASSEMBL...@listserv.uga.edu
No; if the macro doesn't have GBLx &FOO then it isn't part of the scope of the global &FOO, even if there is a GBLx &FOO in open code.

________________________________________
From: IBM Mainframe Assembler List <ASSEMBL...@LISTSERV.UGA.EDU> on behalf of Joseph Reichman <reich...@GMAIL.COM>

Sent: Tuesday, June 27, 2023 12:44 PM
To: ASSEMBL...@LISTSERV.UGA.EDU
Subject: Re: Conditional assembly variable scope

Joseph Reichman

unread,
Jun 27, 2023, 1:34:56 PM6/27/23
to ASSEMBL...@listserv.uga.edu
I think I understand
Open code is a scope just like a macro is scope

In order to have the same variable / value in multiple scopes a GBLx is used

> On Jun 27, 2023, at 1:29 PM, Seymour J Metz <sme...@gmu.edu> wrote:
>
> No; if the macro doesn't have GBLx &FOO then it isn't part of the scope of the global &FOO, even if there is a GBLx &FOO in open code.

Charles Mills

unread,
Jun 27, 2023, 1:37:35 PM6/27/23
to ASSEMBL...@listserv.uga.edu
IOW LCLC &FOO in open code and LCLC &FOO in a macro are different variables.

GBLC &FOO in open code and GBLC &FOO in a macro are the same variable.

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:ASSEMBL...@LISTSERV.UGA.EDU]
On Behalf Of Jonathan Scott
Sent: Tuesday, June 27, 2023 10:05 AM
To: ASSEMBL...@LISTSERV.UGA.EDU
Subject: Re: Conditional assembly variable scope

Paul Gilmartin

unread,
Jun 27, 2023, 2:14:39 PM6/27/23
to ASSEMBL...@listserv.uga.edu
Is there a way to declare a symbol in a macro so that it is
visible in the declaring macro and in macros it calls but
not in open code nor in macros calling the declaring macro?

That would mimic the customary behavior of static scope in
block structured languages and POSIX shell "export", but
not quite REXX "PROCEDURE EXPOSE"..

--
gil

Seymour J Metz

unread,
Jun 27, 2023, 2:17:27 PM6/27/23
to ASSEMBL...@listserv.uga.edu
No. If you have a business case, maybe an RFE for name spaces.

________________________________________
From: IBM Mainframe Assembler List <ASSEMBL...@LISTSERV.UGA.EDU> on behalf of Paul Gilmartin <00000014e0e4a59...@LISTSERV.UGA.EDU>
Sent: Tuesday, June 27, 2023 2:14 PM


To: ASSEMBL...@LISTSERV.UGA.EDU
Subject: Re: Conditional assembly variable scope

On 6/27/23 11:04:43, Jonathan Scott wrote:

Paul Gilmartin

unread,
Jun 27, 2023, 2:34:02 PM6/27/23
to ASSEMBL...@listserv.uga.edu
On 6/27/23 12:17:21, Seymour J Metz wrote:
> No. If you have a business case, maybe an RFE for name spaces.


Oooh! Oooh! Oooh! Also for label symbols as well as conditional
symbols, freeing the programmer of the burden of using distinct
component prefixes in data area definitions.

It could mesh well with labelled USING.

FAP did this with the HE[A]D pseudo-op.

> ________________________________________
> From: Paul Gilmartin

Seymour J Metz

unread,
Jun 27, 2023, 2:45:13 PM6/27/23
to ASSEMBL...@listserv.uga.edu
Or, better, QUAL in IBMAP.

________________________________________
From: IBM Mainframe Assembler List <ASSEMBL...@LISTSERV.UGA.EDU> on behalf of Paul Gilmartin <00000014e0e4a59...@LISTSERV.UGA.EDU>

Sent: Tuesday, June 27, 2023 2:33 PM


To: ASSEMBL...@LISTSERV.UGA.EDU
Subject: Re: Conditional assembly variable scope

On 6/27/23 12:17:21, Seymour J Metz wrote:

Farley, Peter

unread,
Jun 27, 2023, 2:45:43 PM6/27/23
to ASSEMBL...@listserv.uga.edu
OT Re: "Oooh! Oooh! Oooh!" -- Ah, someone else who remembers Toody and Muldoon . . . "Car 54 Where Are You" 😊

Sorry, I could not resist - I needed a laugh today.

Peter

-----Original Message-----
From: IBM Mainframe Assembler List <ASSEMBL...@LISTSERV.UGA.EDU> On Behalf Of Paul Gilmartin
Sent: Tuesday, June 27, 2023 2:34 PM
To: ASSEMBL...@LISTSERV.UGA.EDU
Subject: Re: Conditional assembly variable scope

This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.

Jon Perryman

unread,
Jun 27, 2023, 3:33:56 PM6/27/23
to ASSEMBL...@listserv.uga.edu
Joseph, I don't think your question has been understood. If so, then your question hasn't been answered.
My interpretation of your question is that you have real code that has LCLC &FOO in open code that is behaving like GBLC &FOO. 
    MACRO    TESTMAC ,     GBLC &FOO
&FOO SETC "MACRO"
    MEND 

    LCLC &FOO&FOO  SETC "OPEN CODE"
    TESTMAC ,
    MNOTE *,"FOO=&FOO"

Are you saying that your testing shows &FOO is "MACRO" instead of "OPEN CODE"? 

Seymour J Metz

unread,
Jun 27, 2023, 3:36:45 PM6/27/23
to ASSEMBL...@listserv.uga.edu
One of the local roads is I-66, which has the same scansion as Car 54. Much merriment ensues.

There's a scout troop shoirt a child,
Khrushchev's due at Idlewild,
I-66 where are you


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Assembler List [ASSEMBL...@LISTSERV.UGA.EDU] on behalf of Farley, Peter [00000dc9d8785c2...@LISTSERV.UGA.EDU]
Sent: Tuesday, June 27, 2023 2:45 PM

Seymour J Metz

unread,
Jun 27, 2023, 4:14:43 PM6/27/23
to ASSEMBL...@listserv.uga.edu
I believe that it has been understood and answered, including an answer from an HLASM representative.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Assembler List [ASSEMBL...@LISTSERV.UGA.EDU] on behalf of Jon Perryman [jper...@PACBELL.NET]
Sent: Tuesday, June 27, 2023 3:33 PM

Seymour J Metz

unread,
Jun 27, 2023, 4:23:33 PM6/27/23
to ASSEMBL...@listserv.uga.edu
I assume that I would get an error message for

FOO MACRO ,
GBLA &BAZ
MEND ,

BAR MACRO ,
GBLB &BAZ
MEND ,



--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Assembler List [ASSEMBL...@LISTSERV.UGA.EDU] on behalf of Jonathan Scott [jonatha...@VNET.IBM.COM]
Sent: Tuesday, June 27, 2023 1:04 PM
To: ASSEMBL...@LISTSERV.UGA.EDU
Subject: Re: Conditional assembly variable scope

Reply all
Reply to author
Forward
0 new messages