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

Discussion of the Co:Z Toolkit Dataset Pipes utilities
Post Reply
sctebnt
Posts: 30
Joined: Mon Nov 02, 2009 10:47 pm

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

Post 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
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post 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.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post 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)"
sctebnt
Posts: 30
Joined: Mon Nov 02, 2009 10:47 pm

Post by sctebnt »

Thank you for the sample.

The code is working perfect!!
Post Reply