Re: Conditional assembly variable scope
I assume that I would get an error message for FOO MACRO , GBLA MEND , BAR MACRO , GBLB MEND , -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Jonathan Scott [jonathan_sc...@vnet.ibm.com] Sent: Tuesday, June 27, 2023 1:04 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Conditional assembly variable scope > 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
Re: Conditional assembly variable scope
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 [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Jon Perryman [jperr...@pacbell.net] Sent: Tuesday, June 27, 2023 3:33 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Conditional assembly variable scope 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 in open code that is behaving like GBLC MACROTESTMAC , GBLC SETC "MACRO" MEND LCLC SETC "OPEN CODE" TESTMAC , MNOTE *,"FOO=" Are you saying that your testing shows is "MACRO" instead of "OPEN CODE"? On Tuesday, June 27, 2023 at 10:37:36 AM PDT, Charles Mills wrote: IOW LCLC in open code and LCLC in a macro are different variables. GBLC in open code and GBLC in a macro are the same variable. Charles -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Jonathan Scott Sent: Tuesday, June 27, 2023 10:05 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Conditional assembly variable scope > 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
Re: Conditional assembly variable scope
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 [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Farley, Peter [0dc9d8785c29-dmarc-requ...@listserv.uga.edu] Sent: Tuesday, June 27, 2023 2:45 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Conditional assembly variable scope 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 On Behalf Of Paul Gilmartin Sent: Tuesday, June 27, 2023 2:34 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Conditional assembly variable scope 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 > > 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".. -- 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.
Re: Conditional assembly variable scope
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 in open code that is behaving like GBLC MACRO TESTMAC , GBLC SETC "MACRO" MEND LCLC SETC "OPEN CODE" TESTMAC , MNOTE *,"FOO=" Are you saying that your testing shows is "MACRO" instead of "OPEN CODE"? On Tuesday, June 27, 2023 at 10:37:36 AM PDT, Charles Mills wrote: IOW LCLC in open code and LCLC in a macro are different variables. GBLC in open code and GBLC in a macro are the same variable. Charles -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Jonathan Scott Sent: Tuesday, June 27, 2023 10:05 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Conditional assembly variable scope > 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
Re: Conditional assembly variable scope
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 On Behalf Of Paul Gilmartin Sent: Tuesday, June 27, 2023 2:34 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Conditional assembly variable scope 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 > > 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".. -- 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.
Re: Conditional assembly variable scope
Or, better, QUAL in IBMAP. From: IBM Mainframe Assembler List on behalf of Paul Gilmartin <0014e0e4a59b-dmarc-requ...@listserv.uga.edu> Sent: Tuesday, June 27, 2023 2:33 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Conditional assembly variable scope 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 > > 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
Re: Conditional assembly variable scope
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 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
Re: Conditional assembly variable scope
No. If you have a business case, maybe an RFE for name spaces. From: IBM Mainframe Assembler List on behalf of Paul Gilmartin <0014e0e4a59b-dmarc-requ...@listserv.uga.edu> Sent: Tuesday, June 27, 2023 2:14 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Conditional assembly variable scope On 6/27/23 11:04:43, Jonathan Scott wrote: >> 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. 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
Re: Conditional assembly variable scope
On 6/27/23 11:04:43, Jonathan Scott wrote: 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. 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
Re: Conditional assembly variable scope
IOW LCLC in open code and LCLC in a macro are different variables. GBLC in open code and GBLC in a macro are the same variable. Charles -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Jonathan Scott Sent: Tuesday, June 27, 2023 10:05 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Conditional assembly variable scope > 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
Re: Conditional assembly variable scope
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 wrote: > > No; if the macro doesn't have GBLx then it isn't part of the scope of > the global , even if there is a GBLx in open code. > > > From: IBM Mainframe Assembler List on > behalf of Joseph Reichman > Sent: Tuesday, June 27, 2023 12:44 PM > To: ASSEMBLER-LIST@LISTSERV.UGA.EDU > Subject: Re: Conditional assembly variable scope > > Sorry but I don’t follow > If LCLx is declared in open code > And also let’s say assigned a value the scope is the entire assembly > > If GBLx 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 wrote: >> >> The scope of the global is those units containing GBLx , where a >> unit is either a macro or the open code. >> >> >> From: IBM Mainframe Assembler List on >> behalf of Joseph Reichman >> Sent: Tuesday, June 27, 2023 11:30 AM >> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU >> Subject: Conditional assembly variable scope >> >> 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
Re: Conditional assembly variable scope
No; if the macro doesn't have GBLx then it isn't part of the scope of the global , even if there is a GBLx in open code. From: IBM Mainframe Assembler List on behalf of Joseph Reichman Sent: Tuesday, June 27, 2023 12:44 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Conditional assembly variable scope Sorry but I don’t follow If LCLx is declared in open code And also let’s say assigned a value the scope is the entire assembly If GBLx 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 wrote: > > The scope of the global is those units containing GBLx , where a > unit is either a macro or the open code. > > > From: IBM Mainframe Assembler List on > behalf of Joseph Reichman > Sent: Tuesday, June 27, 2023 11:30 AM > To: ASSEMBLER-LIST@LISTSERV.UGA.EDU > Subject: Conditional assembly variable scope > > 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
Re: Conditional assembly variable scope
Got it thanks > On Jun 27, 2023, at 1:09 PM, Jonathan Scott > wrote: > > >> >> 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
Re: Conditional assembly variable scope
> 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
Re: Conditional assembly variable scope
Sorry but I don’t follow If LCLx is declared in open code And also let’s say assigned a value the scope is the entire assembly If GBLx 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 wrote: > > The scope of the global is those units containing GBLx , where a > unit is either a macro or the open code. > > > From: IBM Mainframe Assembler List on > behalf of Joseph Reichman > Sent: Tuesday, June 27, 2023 11:30 AM > To: ASSEMBLER-LIST@LISTSERV.UGA.EDU > Subject: Conditional assembly variable scope > > 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
Re: Conditional assembly variable scope
The scope of the global is those units containing GBLx , where a unit is either a macro or the open code. From: IBM Mainframe Assembler List on behalf of Joseph Reichman Sent: Tuesday, June 27, 2023 11:30 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Conditional assembly variable scope 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