I use a technique in which I create a CSECT with all of my initial values in it, including any DCBs and associated control blocks. On startup I copy that CSECT in its entirety to GETMAIN storage with a single MVCL. I then use the CSECT data definitions to address the DSECT.
Seventeen years ago I offered on IBMMAIN to share a paper "Converting an RMODE=24 BSAM, BPAM, and/or QSAM Assembler Program to RMODE=ANY" with anyone who wanted it. (It's not a product pitch, there is no product at all.) It describes the technique I mention above. If anyone is interested, the offer still holds. Off-list private notes probably make the most sense. Here is how the paper describes the technique: The basic technique is to add an additional CSECT in which you place all of the 24-bit code. At run time, allocate GETMAIN storage the length of the CSECT “below the line” and copy the CSECT to this 24-bit storage. The CSECT definition is then used “as though it were a DSECT” addressed by a register which actually points to the 24-bit GETMAIN storage. You will need to “relocate” all address constants inside and outside the CSECT that point to addresses inside the CSECT. (The examples are probably easier to understand than this description of the technique.) Charles -----Original Message----- From: IBM Mainframe Assembler List [mailto:[email protected]] On Behalf Of John McKown Sent: Saturday, September 17, 2022 9:40 AM To: [email protected] Subject: Re: Assembler courses On Sat, Sep 17, 2022 at 10:29 AM Ed Jaffe <[email protected]> wrote: > On 9/17/2022 2:06 AM, Abe Kornelis wrote: > > Starting with reentrant programming seems a pretty tough call. > > Not sure why re-entrant programming should be considered heavy lifting. > Would not any assembler course teach about USING? > For me, the biggest problem in making something reentrant is if I need to use a DCB. There is no way, that I know of, to generate a DCB in a GETMAIN'd area. For ACB, there is a GENACB. Too bad z/OS cannot access non-VSAM datasets using an ACB. From what I've read, z/VSE can in some instances. I now like to write "pure" code. That is, code which does not modify anything in the CSECT. All modifiable data is in GETMAIN'd storage (OK, actually I use STORAGE OBTAIN in HLASM).
