I like this, particularly because of the explanation that goes
with it as to why you want to do things this way.
But, might I suggest that you do the member name in lower case?
That way, you can see it, and I think ISPF will allow you to
view/edit it if you need to while fixing a problem if your JOB
fails for any reason.
Regards,
Steve Thompson
On 11/11/2016 07:58 AM, John McKown wrote:
On Fri, Nov 11, 2016 at 6:33 AM, Ward Able, Grant <gwarda...@dtcc.com>
wrote:
Ah rats! Looks like I am going to have to use a new member name every
time. Thanks Paul.
Now to code up a member name lookup piece of code......
I think the following will work.
Allocate the DSN(MEMBER) with a DISP=OLD (for integrity) or SHR (if it's a
PDSE or you're a gambler). Now, do an OPEN on _two_ different DCBs for the
DD. First OPEN a DCB for _input_. Then OPEN a second DCB for _output_. When
you OPEN a member of a PDS for _output_, the access method always positions
to write at the end of the PDS, into "unused" space. You can now read
records from the INPUT DCB and write them immediately to the OUTPUT DCB. At
EOF on the input DCB, close the input DCB. Continue writing the new
information to the output DCB. Finally, close the output DCB. This will do
a STOW to actually update the PDS directory so that the member name now
points to the new version of the member. Until the output DCB is closed,
the PDS directory continues to point to the old member. But remember that
an ABEND will do a close and _will_ update the directory so you _could_
loose the original member contents.
What I'd suggest doing is similar to what you indicated, use a new member
name. Being a weird-o. Remember that all member names are exactly 8
characters in length! The ones that look shorter are actually padded on the
right with blanks. Also, remember that all byte combinations, with the
exception of 8X'FF' are valid as a member name, though the non-printables
can't be used in JCL or TSO ALLOCATE or BPXWDYN. So, weird person that I
am, I would use SVC 99 (which I am fairly sure will accept non-printables
as a member name) as you do above but make the member name be equal to the
original member name, with the last character being X'00'. Now copy the
original contents to the new member. Eventually you will close both the
input & output DCBs successfully. Now, allocate the same DSN, but without a
member name. Open a BPAM DCB on this, rather than the "normal" QSAM / BSAM
you would for a member. Use a STOW delete function to delete the original
member name. Lastly use a STOW rename to change the "weird" member name to
the original member name. I, personally, feels that this is the safest way
to "update" a member of a PDS without coming up with a "new" name all of
the time.
Of course, my method is a bit on the paranoid side. But, remember, just
because you're paranoid doesn't mean that they aren't out to get you. Bugs,
that is. And, it was just a weird idea (from a grand master).
Regards – Grant.
201496 (Internal phone)
+44 (0)2076501496 (External phone)