Page 1 of 1

Looking for ability to BPXWDYN w/o using TO/FROM DSN

Posted: Thu Sep 02, 2010 10:00 pm
by sctebnt
I have a need to dynamically allocate a DDNAME to our step before I know if the DDNAME will be input or output.

I am interested in a program, maybe named DYNALLOC, that I can pass BPXWDYN parms into (just like the -x parm to TO/FROM DSN) where the end result is a DDNAME allocated to my step but no pipe yet.

Later in the job step, when I know the file is to be used as input or output, I will execute the TO/FROM DSN with the //DD: parm.

Some additional background:
The jobs I am supporting need to allocate the DDNAME to the step, determine if there were errors (RACF, INUSE, Duplicate Name, etc..) and then later in the job read from, write to, or both. In order to support this existing logic I need to allocate a file w/o using it right away.

Thanks!

P.S. If you happen to create the C program for this, I would be happy to give it a run. I suspect this will likely be a subset of the existing TO/FROM DSN program.

- Scott Bennett
Hewitt Associates

Posted: Fri Sep 03, 2010 9:02 am
by dovetail
Scott,

The simplest thing would be to write a REXX program in the Unix file system, which would run as a Unix shell command and call BPXWDYN with args pass to the REXX program.

Posted: Fri Sep 03, 2010 12:26 pm
by dovetail
Here's a simple REXX example: (put this into a HFS/zFS file and make the file executable):

Code: Select all

/* REXX */
parse arg keywords
if BPXWDYN(keywords) != 0 then do
  exit RC
end
for example, if the you name the command "bpxwdyn", then you can do this:

Code: Select all

bpxwdyn "alloc dd(mydd) da(my.dataset) shr msg(2)"

Posted: Fri Sep 03, 2010 3:24 pm
by sctebnt
Thank you for the sample.

The code is working perfect!!