Tony Harminc wrote:

On 18 April 2017 at 11:18, Thomas David Rivers <riv...@dignus.com> wrote:
Unless, another pair of eyes has seen some kind of documentation or example
of "this is the proper way to rename a non-VSAM file."

The TSO RENAME command in theory takes care of all this, at least for
cataloged datasets. As far as I know it is still not OCO, so if you
are an ISV with access to IBM's VPL facility (or whatever they call it
these days), you might have a look at module IKJEHREN. I don't have
VPL, so the latest source I have access to is for z/OS 1.4, and that
version is certainly full of code to deal with these issues.

Maybe IBM should cut & paste the comment lines from this module and
include them in the DFSMS book...

Aha!

What a terrific idea - I was able to find the old PLM from 1971 for
the RENAME command.

Looking at the flowcharts; it appears this is the order:

     ALLOCATE data set
     if ALLOC-successful ten
        RENAME data set
        if RENAME-succesful then
           CATALOG New Data Set Name
           if CATALOG-successful  then
             unCATALOG Old Data Set Name
             if unCATALOG-not-successful
                 warning message to user
             end-if
             unALLOC data set
           end-if
        end-if
    end-if

(There are some jumps around I'm not describing in the event
  of failures of some of the steps.)

So - I think the basic steps are:

   ALLOC data set
   RENAME data set
   CATALOG new name
   unCATALOG old name
   unALLOC data set

Perhaps it's the ALLOC/unALLOC steps that I'm missing - we don't
bother to do that...

I did see a note that you can RENAME/CATALOG an allocated data set
if the data set isn't OPEN... perhaps the allocation is holding a lock
of some kind?

   - Dave Rivers -
--
riv...@dignus.com                        Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com

----------------------------------------------------------------------
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