Gary,

Use this trick to let BPXWDYN allocate to a new DD instead of using the
existing one. (Credit to Paul Gilmartin who's made this discovery in one of
his earlier discussion on IBM-Main which is available at
https://groups.google.com/forum/#!msg/bit.listserv.ibm-main/QKKcj6LYBik/tF68-svA50sJ
 )

so you just need to supply the RECFM parm to get a new allocation. I chose
RECFM (F,B) .  if you're going to actually use the dd, then it is a catch
22 as you need to know ahead of time what the recfm is,  However if you do
know the RECFM then here is a work around

Address tso "alloc fi(abug) da('any.dataset.name') shr resue"
Call bpxwdyn,
 "Alloc rtddn(dd) da('any.dataset.name') recfm(f,b) shr reuse"
Say 'DDname allocated is 'dd
Call bpxwdyn "Free fi("dd")"


Thanks,
Kolusu

IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> wrote on
02/19/2018 06:18:13 AM:

> From: Gary Freestone <maz...@iinet.net.au>
> To: IBM-MAIN@LISTSERV.UA.EDU
> Date: 02/19/2018 06:29 AM
> Subject: BPXWDYN - Bug or no bug ?
> Sent by: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU>
>
> These days we are opting for BPXWDYN in our REXXs instead of TSO ALLOC.
One
> of the main reason for the switch is BPXWDYN's ability to return the
DDNAME
> it allocated via the RTDDN parameter.
>
>
>
> Chasing down a bug in my code lead me to discover an idiosyncrasy with
> BPXWDYN that I think is a bug, but maybe not. So I'm seeking your
opinions.
>
>
>
> If I have the following
>
>
>
>
>
> Call bpxwdyn "Alloc rtddn(dd) da('any.dataset.name') shr reuse"
>
> Say 'DDname allocated is 'dd
>
> Call bpxwdyn "Free fi("dd")"
>
> Running this exec gives something like "DDname allocated is SYS00746"
>
> However, if any.dataset.name is already allocated to an alternate DDNAME
> that is not in concatenation then, instead of allocating a new DDname it
> just returns the DDNAME of the existing allocation.
>
> You can see this with this code
>
> Address tso "alloc fi(abug) da('any.dataset.name') shr resue"
>
> Call bpxwdyn "Alloc rtddn(dd) da('any.dataset.name') shr reuse"
>
> Say 'DDname allocated is 'dd
>
> Call bpxwdyn "Free fi("dd")"
>
> And you will get "DDname allocated is ABUG"
>
> Problem is because I'm not getting a new allocation my FREE is freeing up
a
> DDNAME allocated by a totally different process.  In my case causing an
> abend sometime later because a DDname that should be allocated is not.
>
> This doesn't seem right to me.  An "ALLOC" should do a new allocation
every
> time.
>
>
>
> Comments ????
>
>
>
>
>
> Gary Freestone
>
>
>
>
> ----------------------------------------------------------------------
> 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