John, you might be interested in this thread:

http://www.mail-archive.com/ibm-main@listserv.ua.edu/msg01761.html

Specifically, the binder option COMPAT=LKED.

LKED
Specifies that certain binder processing options are to work in a manner 
compatible with the linkage editor. Specific processing affected by this 
specification includes: 
        * REUS—If a section is encountered in a module with a lower reusability 
than that specified on the REUS option, the reusability of the module is 
automatically downgraded. An information message is issued and the return code 
remains unchanged.

This may or not be useful, because in the end it seems to me that you DO want 
to make the assembler module re-entrant.  It wasn't clear to me if you had made 
progress in doing so.

I will say that, though I put the project on hold after initial success with 
this, I (a mere application developer) was able to relatively easily convert 
some batch/CICS shared assembler routines to be re-entrant by LE enabling them. 
 I even wrote a macro (AUTOSTG) to help me with this.
CVASCBLK CSECT
         CEEDSA ,
         CEECAA ,
*
CVASCBLK CEEENTRY MAIN=NO,AUTO=L'CBLKAUTO
CBLKAUTO AUTOSTG USING=YES
         MVC   PARMLIST(PARMLGTH),0(R1) SAVE CALLING LIST
         LM    R4,R9,0(R1)         LOAD PARAMETERS FROM PROGRAM
[...]
EXIT     DS    0H
         CEETERM RC=0
         SPACE 3
         LTORG ,
CBLKAUTO AUTOSTG DSECT=START
PARMLIST DS    0F
PARMINPM DS    F
PARMOUTP DS    F
PARMMSGL DS    F
PARMBLKC DS    F
PARMBLKS DS    F
PARMOFFS DS    F
PARMDELM DS    F
PARMLGTH EQU   *-PARMLIST
TRT      DC    XL256'00'
CBLKAUTO AUTOSTG DSECT=END


Original code
CVASCBLK CSECT
CVASCBLK AMODE ANY
CVASCBLK RMODE ANY
         SAVE  (14,12)
         BALR  R3,0
         USING *,R3
         B     START
         DC    CL8'CVASCBLK'
START    DS    0H
         MVC   PARMLIST(PARMLGTH),0(R1) SAVE CALLING LIST
         ST    R13,SAVE13
         LA    R13,CBLKSAVE
         LM    R4,R9,0(R1)         LOAD PARAMETERS FROM PROGRAM
[...]
EXIT     DS    0H
         L     R13,SAVE13
         RETURN (14,12),RC=0
         SPACE 3
         LTORG ,
PARMLIST DS    0F
PARMINPM DS    F
PARMOUTP DS    F
PARMMSGL DS    F
PARMBLKC DS    F
PARMBLKS DS    F
PARMOFFS DS    F
PARMDELM DS    F
PARMLGTH EQU   *-PARMLIST
         DS    0D
CBLKSAVE DS    9D
SAVE13   DS    F
TRT      DC    XL256'00'


Obviously any non-reentrant code needs to be made reentrant.

And here is the AUTOSTG macro.  (Wow, its a lot smaller than I'd remembered.)


.**********************************************************************
.* NOTE THAT CEEDSA MACRO REQUIRED PRIOR TO FIRST AUTOSTG MACRO       *
.**********************************************************************
         MACRO
&LABEL   AUTOSTG &DSECT=,&USING=NO
         GBLC  &CEEOEPVNX        Label of Main Entry; from CEEENTRY
         LCLC  &AUTOSECT
&AUTOSECT SETC '@&LABEL'
.DSECT   ANOP ,
         AIF ('&DSECT' EQ 'START').START
         AIF ('&DSECT' EQ 'END').END
         AGO .CHKUSING
         MEXIT ,
.**********************************************************************
.*       DSECT=START                                                  *
.**********************************************************************
.START   ANOP ,
&AUTOSECT DSECT ,
         ORG   *+CEEDSASZ          Leave space for the DSA fixed part
         AGO .CHKUSING
.**********************************************************************
.*       DSECT=END                                                    *
.**********************************************************************
.END     ANOP  ,
         LCLC  &OEPVNX
&LABEL   EQU   &AUTOSECT,*-&AUTOSECT,C'C'
&OEPVNX  SETC  '&CEEOEPVNX'
         AIF ('&OEPVNX' EQ '').CHKUSING
&OEPVNX  CSECT ,                   Continue primary CSECT
.**********************************************************************
.CHKUSING AIF ('&USING' NE 'YES').EXIT
.**********************************************************************
.*       USING=YES                                                    *
.**********************************************************************
         USING &LABEL,CEEDSA       Auto stg and DSA use the same base
.EXIT    MEXIT
.**********************************************************************
         MEND
         EJECT






>________________________________
> From: John McKown <john.archie.mck...@gmail.com>
>To: IBM-MAIN@LISTSERV.UA.EDU 
>Sent: Tuesday, June 25, 2013 9:20 AM
>Subject: Re: z/OS subroutine in assembler, used in both batch & CICS , making 
>re-entrant
> 
>
>On Tue, Jun 25, 2013 at 9:56 AM, Tom Marchant <m42tom-ibmm...@yahoo.com>wrote:
>
>> On Tue, 25 Jun 2013 08:15:46 -0500, John McKown <
>> john.archie.mck...@gmail.com> wrote:
>>
>> >1) Can I use a BAKR instruction in CICS successfully.
>>
>> You will still need to provide a save area, which would be marked with
>> "F1SA"
>> in offset 4, or set register 13 to zero.  This is necessary for debugging
>> purposes,
>> even if you never call any other program that will require a save area.
>>  See
>> Chapter 2 of the Assembler Services Guide for release 12 or above of z/OS.
>>
>> >4) What about not using a save area at all?
>>
>> Please don't do that.
>>
>
>Looks like I'm going to be forced to. That is, use the caller's save area
>and not set up one of my own. I don't use any z/OS services (SVC, PC) or
>even macros in the code. The code gets a buffer and modifies it using only
>CPU instructions.  Otherwise, I must either abandon the attempt altogether;
>which makes debugging harder, but not impossible;  or make the HLASM
>subroutine LE compliant. I don't want to do this. It might be considered
>"disruptive" and it is definitely "new and unproven" and so close to
>anathema to those above me and those who must use it. This is one reason to
>recode into COBOL. That is "understood" and "accepted" by all. And, as a
>big plus, will get me out of the support loop.
>
>Despite what has been posted about CICS not supporting doing a COBOL CALL
>to a composite linked subroutine, we do it at present for these routines.
>The only "gotcha" is that the CALL'd code cannot do any CICS requests. The
>code in question is "pure CPU" code without any subroutine calls, PCs, SVCs
>or even macro invocations.
>
>--
>
>> Tom Marchant
>>
>> ----------------------------------------------------------------------
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>
>
>
>
>-- 
>This is a test of the Emergency Broadcast System. If this had been an
>actual emergency, do you really think we'd stick around to tell you?
>
>Maranatha! <><
>John McKown
>
>----------------------------------------------------------------------
>For IBM-MAIN subscribe / signoff / archive access instructions,
>send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
>
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to