BUILD is only capable of creating a BUFCB that is immediately followed by the 
buffers, as it only has one operand to indicate the memory location, as you no 
doubt know. Earlier you said your program does not use BUILD. If your program 
had used BUILD, like the OP's does, and given it the address of an area above 
the line, which we don't know in the OP's case, it would be necessary to copy 
the BUFCB part of the area below the line and point the DCB to the copy. This 
possibility is not mentioned in the manual. The description of the BUILD 
operand says "If the area resides above the line, it cannot be used by other 
access method macros".

This page in Chapter 21 of Using Data Sets:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2D4A0/3.2.8

says "For BSAM, IBM recommends that you allocate data areas or buffers through 
GETMAIN, STORAGE, or CPOOL macros and not through BUILD, GETPOOL, or by the 
system during OPEN. Allocated areas can be above the line."

This leads me to believe that the OP's program was not written with buffers 
above the line in mind, since it uses BUILD, but that is just a guess.

Bill

 On Mon, 3 Jun 2013 08:28:19 -0400, Charles Mills wrote:

>Right. Honest, I was not trying to be obscure or overly clever.
>
>What I do in all of my xSAM/BPAM code is code all of the DCB's and DECB's and 
>other RMODE 24 stuff in its own CSECT (and sometimes, just because it 
>organizes the code better, even other small things that do not HAVE to be 
>RMODE 24 like a DCBE). I then do a GETMAIN 24 at run time for the length of 
>the CSECT and copy all of the QSAM "stuff" into the GETMAIN area. With some 
>cleverness you can then use the CSECT like it was a DSECT for addressing the 
>tables in the GETMAIN area. Sometimes you have to manually relocate a couple 
>of address constants, like the DECB pointer to the DCB.
>
>However, I don't think I copy any BUFCB's anywhere. I think QSAM automatically 
>allocates the BUFCB wherever it chooses (presumably it chooses RMODE 24) and 
>the buffers wherever you tell it to allocate them (RMODE ANY in my case). Am I 
>confused?
>
>Charles
>
>-----Original Message-----
>From: IBM Mainframe Discussion List [mailto:[email protected]] On 
>Behalf Of Bill Godfrey
>Sent: Monday, June 03, 2013 12:11 AM
>To: [email protected]
>Subject: Re: Examples of getbuf and build usage
>
>It can be done that way, you are right, but I figure if the OP's program is 
>using BUILD and GETBUF then my statements may prove to help him with his 
>problem, and that's my reason for posting what I did, to help the OP. I could 
>have qualified my statement by adding saying "unless the program is copying 
>the BUFCB (and not the buffers) below the line" but I thought "but who does 
>that?" Well, now I know who does that, or something like that.
>

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

Reply via email to