Hi Charles,

We use a routine that calls dynalloc() that allocates and returns a DUMMY
DDNAME, and then use it in BPXWDYN with "reuse".  (See also JZOS:
 ZFIle.allocDummyDDName() )

Bill Schoen was discussing allowing for return of variables outside of REXX
in a 2006 MVS-OE thread "use of bpxwdyn outside of rexx".
I suggest asking your question on MVS-OE.



Kirk Wolf
Dovetailed Technologies
http://dovetail.com

On Wed, May 6, 2015 at 12:34 PM, Charles Mills <[email protected]> wrote:

> Thanks for your help. Yeah, I checked LE Vendor Interfaces before I
> posted. I have finally learned "when you can't find it where you think it
> ought to be, look in Vendor Interfaces."
>
> Yeah, pretty much resigned now to my own dynalloc and OPEN. Good
> suggestion on chasing the DEB chain, but that's not going to be any easier
> than doing it "right."
>
> Annoying that BPXWDYN cannot return a DD name. Have to do some serious
> thinking about the implications of a hard DD name. Resigned to the
> possibility of having to use C dynalloc(). I remember it as being a PITA
> but the only other time I used it I was brand new to C and especially C on
> Z and so it may not be so bad as I recall. (I have used assembler SVC 99
> extensively, back in the bad old days when I wrote everything in Assembler.)
>
> Charles
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On
> Behalf Of Tony Harminc
> Sent: Wednesday, May 06, 2015 9:21 AM
> To: [email protected]
> Subject: Re: Possible to get DCB address after C fopen()
>
> On 6 May 2015 at 09:50, Charles Mills <[email protected]> wrote:
> > I suspect I know the answer to this question. Is there any
> > generally-accepted way to get the DCB address following a C fopen()?
> > (I say "generally accepted" because I assume there is no supported
> > way. I could live with something with some risk, but not a total
> > hack.)
>
> The supported (in the sense that all fields and control blocks are PI or
> at least very well known for decades) is to chase the DEB chain.
> Each DEB points to an open DCB (or ACB) and each such xCB has a TIOT
> offset to the DDNAME entry. So if you know the DDNAME you can find any open
> DCBs for it without reference to any C or LE control blocks.
>
> But if it was dynalloc'd then you won't know the DDNAME, presumably.
> You can go a step further and do the same thing with DSNAMEs, though it's
> trickier. If you know the DSNAME, obviously.
>
> Otherwise I'd check the LE Vendor Interfaces book. Though the more I think
> about it, the more I think I/O in general is probably language dependant,
> and may not be handled by LE. And there is no C/C++ Vendor Interfaces book,
> afaik.
>
> ----------------------------------------------------------------------
> 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