Aha! When did that come in? I've been using LOCTR for that.

-- 
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
עַם יִשְׂרָאֵל חַי
נֵ֣צַח יִשְׂרָאֵ֔ל לֹ֥א יְשַׁקֵּ֖ר



________________________________________
From: IBM Mainframe Discussion List <[email protected]> on behalf of 
Charles Hardee <[email protected]>
Sent: Tuesday, January 7, 2025 5:58 PM
To: [email protected]
Subject: Re: Assembly language: Re-establishing the correct xSECT -- DSECT or 
CSECT

External Message: Use Caution


Grab your handy dandy Assembler Language Reference and look up &SYSSTYP.
It takes on the value os START, CSECT, DSECT, RSECT or COM.

Chuck

On Tue, Jan 7, 2025 at 3:30 PM Richard Zierdt <
[email protected]> wrote:

> When invoking a macro, it's nice if the macro restores the section name,
> be it a CSECT or DSECT (or RSECT?), that invoked it.
> Example:
>
> A        CSECT
> SAVEAREA DSECT
>          MACRO1
> (MACRO1 creates another DSECT, and can be invoked from a CSECT or DSECT)
> (MACRO1 has a &SYSECT CSECT statement at the end, trying to be nice and
> all)
> &SYSECT  CSECT  which generates:
> +SAVEAREA CSECT
> ** ASMA155S Previous use of symbol is not this section type
>
> The error statement is correct, however, can a macro determine the
> "section type" that invoked it?   Perhaps some system variable in the same
> realm as &SYSECT that indicates the "section type" ?  Or an attribute of
> &SYSECT ?
>
> MACRO1 can be invoked from a CSECT or DSECT.  It would be helpful if the
> assembler had an indicator to tell which one it was (and perhaps it does).
>
> (The Language Reference Version 1 Release 6 manual does not discuss
> "section type."  )
>
> What would help is a &SECTYP system variable, where &SECTYP is equal to
> DSECT or CSECT depending on the environment when the macro was invoked:
>
> &SYSECT  &SECTYP    would then restore the environment as it was when the
> macro was invoked.
>
> Or an expansion of the Type attribute for &SYSECT.   The Language
> Reference, chapter 7, states the Type attribute for &SYSECT is always U,
> but when these macro instructions are executed:
>
> &TA      SETC  T'&SYSECT      Type attribute
>          Mnote ,'Type attribute of SYSECT is &TA'
> This is returned:
>          ,Type attribute of SYSECT is J
>
> The Language Reference, chapter 9, lists Data attributes, and that for the
> Type attribute,  J means the variable is a Control section name. That makes
> sense, but there seems to be a discrepancy in the manual, or I'm
> misunderstanding it, which is probable.
>
> Another Type attribute value for &SYSECT could be "C" for CSECT, "D" for
> DSECT, etc.
>
> Now the Operation code attribute for &SYSECT seems to be U:
>
> &OC      SETC  O'&SYSECT           Operation code attribute
>          Mnote 'Op Code attribute of SYSECT is &OC'
> Returns
>         +Op Code attribute of SYSECT is U
>
> Suggesting a mix-up in the manual?
>
> Another solution would be to add an additional parameter to MACRO1, and
> add code to check that parameter when restoring the invoking environment,
> but it's useful to know where a macro is being interpreted anyhow, DSECT or
> CSECT.   How can the assembler not know this?
>
> Any clarification appreciated.  Thanks -
> Richard Zierdt
>
> Confidentiality Warning/Avertissement de confidentialité:
>
> This message is intended only for the named recipients. This message may
> contain information that is privileged or confidential. If you are not the
> named recipient, its employee or its agent, please notify us immediately
> and permanently destroy this message and any copies you may have. Ce
> message est destiné uniquement aux destinataires dûment nommés. Il peut
> contenir de l'information privilégiée ou confidentielle. Si vous n'êtes pas
> le destinataire dûment nommé, son employé ou son mandataire, veuillez nous
> aviser sans tarder et supprimer ce message ainsi que toute copie qui peut
> en avoir été faite.
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to